Class: FbGraph::Thread
- Includes:
- Connections::FormerParticipants, Connections::Messages, Connections::Participants, Connections::Senders
- Defined in:
- lib/fb_graph/thread.rb
Instance Attribute Summary collapse
-
#message_count ⇒ Object
Returns the value of attribute message_count.
-
#snippet ⇒ Object
Returns the value of attribute snippet.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#unread_count ⇒ Object
Returns the value of attribute unread_count.
-
#updated_time ⇒ Object
Returns the value of attribute updated_time.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Thread
constructor
A new instance of Thread.
Methods included from Connections::Senders
Methods included from Connections::FormerParticipants
Methods included from Connections::Participants
Methods included from Connections::Messages
Methods inherited from Node
#connection, #destroy, fetch, #fetch
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Thread
Returns a new instance of Thread.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fb_graph/thread.rb', line 10 def initialize(identifier, attributes = {}) super @subject = attributes[:subject] # NOTE: Probably obsolete @snippet = attributes[:snippet] @message_count = attributes[:message_count] @unread_count = attributes[:unread_count].to_i @tags = [] if attributes[:tags] Collection.new(attributes[:tags]).each do |tag| @tags << Tag.new(tag) end end if attributes[:updated_time] @updated_time = Time.parse(attributes[:updated_time]).utc end # cached connection @_messages_ = Collection.new(attributes[:messages]) @_participants_ = Collection.new(attributes[:participants]) @_former_participants_ = Collection.new(attributes[:former_articipants]) @_senders_ = Collection.new(attributes[:senders]) end |
Instance Attribute Details
#message_count ⇒ Object
Returns the value of attribute message_count.
8 9 10 |
# File 'lib/fb_graph/thread.rb', line 8 def @message_count end |
#snippet ⇒ Object
Returns the value of attribute snippet.
8 9 10 |
# File 'lib/fb_graph/thread.rb', line 8 def snippet @snippet end |
#subject ⇒ Object
Returns the value of attribute subject.
8 9 10 |
# File 'lib/fb_graph/thread.rb', line 8 def subject @subject end |
#tags ⇒ Object
Returns the value of attribute tags.
8 9 10 |
# File 'lib/fb_graph/thread.rb', line 8 def @tags end |
#unread_count ⇒ Object
Returns the value of attribute unread_count.
8 9 10 |
# File 'lib/fb_graph/thread.rb', line 8 def unread_count @unread_count end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
8 9 10 |
# File 'lib/fb_graph/thread.rb', line 8 def updated_time @updated_time end |