Class: FbGraph::Message
- Includes:
- Connections::Tags
- Defined in:
- lib/fb_graph/message.rb
Instance Attribute Summary collapse
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#from ⇒ Object
Returns the value of attribute from.
-
#message ⇒ Object
Returns the value of attribute message.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#to ⇒ Object
Returns the value of attribute to.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Message
constructor
A new instance of Message.
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Message
Returns a new instance of Message.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fb_graph/message.rb', line 10 def initialize(identifier, attributes = {}) super @subject = attributes[:subject] @message = attributes[:message] if (from = attributes[:from]) @from = User.new(from[:id], from) end @to = [] if attributes[:to] Collection.new(attributes[:to]).each do |to| @to << User.new(to[:id], to) end end @tags = [] if attributes[:tags] Collection.new(attributes[:tags]).each do |tag| @tags << Tag.new(tag) end end if attributes[:created_time] @created_time = Time.parse(attributes[:created_time]).utc end # cached connection @_tags_ = Collection.new(attributes[:tags]) end |
Instance Attribute Details
#created_time ⇒ Object
Returns the value of attribute created_time.
8 9 10 |
# File 'lib/fb_graph/message.rb', line 8 def created_time @created_time end |
#from ⇒ Object
Returns the value of attribute from.
8 9 10 |
# File 'lib/fb_graph/message.rb', line 8 def from @from end |
#message ⇒ Object
Returns the value of attribute message.
8 9 10 |
# File 'lib/fb_graph/message.rb', line 8 def @message end |
#subject ⇒ Object
Returns the value of attribute subject.
8 9 10 |
# File 'lib/fb_graph/message.rb', line 8 def subject @subject end |
#tags ⇒ Object
Returns the value of attribute tags.
8 9 10 |
# File 'lib/fb_graph/message.rb', line 8 def @tags end |
#to ⇒ Object
Returns the value of attribute to.
8 9 10 |
# File 'lib/fb_graph/message.rb', line 8 def to @to end |