Class: FbGraph::Comment

Inherits:
Node
  • Object
show all
Defined in:
lib/fb_graph/comment.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier

Instance Method Summary collapse

Methods inherited from Node

#destroy, fetch, #fetch

Methods included from Comparison

#==

Constructor Details

#initialize(identifier, options = {}) ⇒ 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, options = {})
  super
  if (from = options[:from])
    @from = if from[:category]
      FbGraph::Page.new(from.delete(:id), from)
    else
      FbGraph::User.new(from.delete(:id), from)
    end
  end
  @message = options[:message]
  if options[:created_time]
    @created_time = Time.parse(options[:created_time]).utc
  end
end

Instance Attribute Details

#created_timeObject

Returns the value of attribute created_time.



3
4
5
# File 'lib/fb_graph/comment.rb', line 3

def created_time
  @created_time
end

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/fb_graph/comment.rb', line 3

def from
  @from
end

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/fb_graph/comment.rb', line 3

def message
  @message
end