Class: FbGraph::Message
Instance Attribute Summary collapse
-
#created_time ⇒ Object
TODO: include Connections::Attachments include Connections::Shares.
-
#from ⇒ Object
TODO: include Connections::Attachments include Connections::Shares.
-
#message ⇒ Object
TODO: include Connections::Attachments include Connections::Shares.
-
#subject ⇒ Object
TODO: include Connections::Attachments include Connections::Shares.
-
#tags ⇒ Object
TODO: include Connections::Attachments include Connections::Shares.
-
#to ⇒ Object
TODO: include Connections::Attachments include Connections::Shares.
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
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Message
Returns a new instance of Message.
9 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/message.rb', line 9 def initialize(identifier, attributes = {}) super @subject = attributes[:subject] @message = attributes[:message] if (from = attributes[:from]) @from = User.new(from.delete(:id), from) end @to = [] if attributes[:to] Collection.new(attributes[:to]).each do |to| @to << User.new(to.delete(: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 end |
Instance Attribute Details
#created_time ⇒ Object
TODO: include Connections::Attachments include Connections::Shares
7 8 9 |
# File 'lib/fb_graph/message.rb', line 7 def created_time @created_time end |
#from ⇒ Object
TODO: include Connections::Attachments include Connections::Shares
7 8 9 |
# File 'lib/fb_graph/message.rb', line 7 def from @from end |
#message ⇒ Object
TODO: include Connections::Attachments include Connections::Shares
7 8 9 |
# File 'lib/fb_graph/message.rb', line 7 def @message end |
#subject ⇒ Object
TODO: include Connections::Attachments include Connections::Shares
7 8 9 |
# File 'lib/fb_graph/message.rb', line 7 def subject @subject end |
#tags ⇒ Object
TODO: include Connections::Attachments include Connections::Shares
7 8 9 |
# File 'lib/fb_graph/message.rb', line 7 def @tags end |
#to ⇒ Object
TODO: include Connections::Attachments include Connections::Shares
7 8 9 |
# File 'lib/fb_graph/message.rb', line 7 def to @to end |