Class: FbGraph::Comment
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.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Comment
constructor
A new instance of Comment.
Methods inherited from Node
#connection, #destroy, fetch, #fetch
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Comment
Returns a new instance of Comment.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/fb_graph/comment.rb', line 5 def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = if from[:category] FbGraph::Page.new(from.delete(:id), from) else FbGraph::User.new(from.delete(:id), from) end end @message = attributes[:message] if attributes[:created_time] @created_time = Time.parse(attributes[:created_time]).utc end end |
Instance Attribute Details
#created_time ⇒ Object
Returns the value of attribute created_time.
3 4 5 |
# File 'lib/fb_graph/comment.rb', line 3 def created_time @created_time end |
#from ⇒ Object
Returns the value of attribute from.
3 4 5 |
# File 'lib/fb_graph/comment.rb', line 3 def from @from end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/fb_graph/comment.rb', line 3 def @message end |