Class: GSGraph::Comment
- Defined in:
- lib/gs_graph/comment.rb
Instance Attribute Summary collapse
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#from ⇒ Object
Returns the value of attribute from.
-
#like_count ⇒ Object
Returns the value of attribute like_count.
-
#message ⇒ Object
Returns the value of attribute message.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Comment
constructor
A new instance of Comment.
Methods included from GSGraph::Connections::Likes::Likable
Methods included from GSGraph::Connections::Likes
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Comment
Returns a new instance of Comment.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gs_graph/comment.rb', line 8 def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = if from[:category] Page.new(from[:id], from) else User.new(from[:id], from) end end @message = attributes[:message] @like_count = attributes[:likes] 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.
6 7 8 |
# File 'lib/gs_graph/comment.rb', line 6 def created_time @created_time end |
#from ⇒ Object
Returns the value of attribute from.
6 7 8 |
# File 'lib/gs_graph/comment.rb', line 6 def from @from end |
#like_count ⇒ Object
Returns the value of attribute like_count.
6 7 8 |
# File 'lib/gs_graph/comment.rb', line 6 def like_count @like_count end |
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/gs_graph/comment.rb', line 6 def @message end |