Class: FbGraph::Comment
- Includes:
- FbGraph::Connections::Comments, FbGraph::Connections::Likes, FbGraph::Connections::Likes::Likable
- Defined in:
- lib/fb_graph/comment.rb
Instance Attribute Summary collapse
-
#can_comment ⇒ Object
(also: #commentable?)
Returns the value of attribute can_comment.
-
#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
- #can_comment? ⇒ Boolean
-
#initialize(identifier, attributes = {}) ⇒ Comment
constructor
A new instance of Comment.
Methods included from FbGraph::Connections::Likes::Likable
Methods included from FbGraph::Connections::Likes
Methods included from FbGraph::Connections::Comments
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.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fb_graph/comment.rb', line 9 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] @can_comment = attributes[:can_comment] if attributes[:created_time] @created_time = Time.parse(attributes[:created_time]).utc end end |
Instance Attribute Details
#can_comment ⇒ Object Also known as: commentable?
Returns the value of attribute can_comment.
7 8 9 |
# File 'lib/fb_graph/comment.rb', line 7 def can_comment @can_comment end |
#created_time ⇒ Object
Returns the value of attribute created_time.
7 8 9 |
# File 'lib/fb_graph/comment.rb', line 7 def created_time @created_time end |
#from ⇒ Object
Returns the value of attribute from.
7 8 9 |
# File 'lib/fb_graph/comment.rb', line 7 def from @from end |
#like_count ⇒ Object
Returns the value of attribute like_count.
7 8 9 |
# File 'lib/fb_graph/comment.rb', line 7 def like_count @like_count end |
#message ⇒ Object
Returns the value of attribute message.
7 8 9 |
# File 'lib/fb_graph/comment.rb', line 7 def @message end |
Instance Method Details
#can_comment? ⇒ Boolean
27 28 29 |
# File 'lib/fb_graph/comment.rb', line 27 def can_comment? !!can_comment end |