Class: FbGraph::Thread

Inherits:
Node
  • Object
show all
Includes:
Connections::FormerParticipants, Connections::Messages, Connections::Participants, Connections::Senders, Connections::Tags
Defined in:
lib/fb_graph/thread.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier

Instance Method Summary collapse

Methods included from Connections::Tags

#tags

Methods included from Connections::Senders

#senders

Methods included from Connections::FormerParticipants

#former_participants

Methods included from Connections::Participants

#participants

Methods included from Connections::Messages

#messages

Methods inherited from Node

#connection, #destroy, fetch, #fetch, #update

Methods included from Comparison

#==

Constructor Details

#initialize(identifier, attributes = {}) ⇒ Thread

Returns a new instance of Thread.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/fb_graph/thread.rb', line 11

def initialize(identifier, attributes = {})
  super
  @snippet = attributes[:snippet]
  @message_count = attributes[:message_count]
  @unread_count = attributes[:unread_count].to_i
  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])
  @_tags_ = Collection.new(attributes[:tags])
end

Instance Attribute Details

#message_countObject

Returns the value of attribute message_count.



9
10
11
# File 'lib/fb_graph/thread.rb', line 9

def message_count
  @message_count
end

#snippetObject

Returns the value of attribute snippet.



9
10
11
# File 'lib/fb_graph/thread.rb', line 9

def snippet
  @snippet
end

#unread_countObject

Returns the value of attribute unread_count.



9
10
11
# File 'lib/fb_graph/thread.rb', line 9

def unread_count
  @unread_count
end

#updated_timeObject

Returns the value of attribute updated_time.



9
10
11
# File 'lib/fb_graph/thread.rb', line 9

def updated_time
  @updated_time
end