Class: Redd::Object::PrivateMessage

Inherits:
Thing
  • Object
show all
Includes:
Thing::Inboxable
Defined in:
lib/redd/object/private_message.rb

Instance Attribute Summary collapse

Attributes inherited from Thing

#id, #kind

Attributes inherited from Base

#attributes, #client

Instance Method Summary collapse

Methods included from Thing::Inboxable

#mark_as_read, #mark_as_unread, #reply

Methods inherited from Thing

#==, #fullname

Methods inherited from Base

#[], attr_reader, define_attribute_method, define_predicate_method, #initialize

Constructor Details

This class inherits a constructor from Redd::Base

Instance Attribute Details

#authorObject (readonly) Also known as: from, to

Returns the value of attribute author.



20
21
22
# File 'lib/redd/object/private_message.rb', line 20

def author
  @author
end

#bodyObject (readonly)

Returns the value of attribute body.



10
11
12
# File 'lib/redd/object/private_message.rb', line 10

def body
  @body
end

#body_htmlObject (readonly)

Returns the value of attribute body_html.



11
12
13
# File 'lib/redd/object/private_message.rb', line 11

def body_html
  @body_html
end

#contextObject (readonly)

Returns the value of attribute context.



17
18
19
# File 'lib/redd/object/private_message.rb', line 17

def context
  @context
end

#destObject (readonly)

Returns the value of attribute dest.



19
20
21
# File 'lib/redd/object/private_message.rb', line 19

def dest
  @dest
end

#distinguishedObject (readonly)

Returns the value of attribute distinguished.



14
15
16
# File 'lib/redd/object/private_message.rb', line 14

def distinguished
  @distinguished
end

#first_message_nameObject (readonly)

Returns the value of attribute first_message_name.



16
17
18
# File 'lib/redd/object/private_message.rb', line 16

def first_message_name
  @first_message_name
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



13
14
15
# File 'lib/redd/object/private_message.rb', line 13

def parent_id
  @parent_id
end

#subredditObject (readonly)

Returns the value of attribute subreddit.



12
13
14
# File 'lib/redd/object/private_message.rb', line 12

def subreddit
  @subreddit
end

#was_commentObject (readonly)

Returns the value of attribute was_comment.



15
16
17
# File 'lib/redd/object/private_message.rb', line 15

def was_comment
  @was_comment
end

Instance Method Details

#createdObject



25
26
27
# File 'lib/redd/object/private_message.rb', line 25

def created
  @created ||= Time.at(@attributes[:created_utc])
end

#repliesObject



29
30
31
# File 'lib/redd/object/private_message.rb', line 29

def replies
  @replies ||= client.objects_from_listing(@attributes[:replies])
end