Class: FbGraph::Status

Inherits:
Node
  • Object
show all
Includes:
Connections::Comments, Connections::Likes
Defined in:
lib/fb_graph/status.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier

Instance Method Summary collapse

Methods included from Connections::Likes

#likes

Methods included from Connections::Comments

#comment!, #comments, #like!, #unlike!

Methods inherited from Node

#connection, #destroy, fetch, #fetch

Methods included from Comparison

#==

Constructor Details

#initialize(identifier, attributes = {}) ⇒ Status

Returns a new instance of Status.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fb_graph/status.rb', line 8

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 (updated_time = attributes.delete(:updated_time))
    @updated_time = Time.parse(updated_time).utc
  end
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



6
7
8
# File 'lib/fb_graph/status.rb', line 6

def from
  @from
end

#messageObject

Returns the value of attribute message.



6
7
8
# File 'lib/fb_graph/status.rb', line 6

def message
  @message
end

#updated_timeObject

Returns the value of attribute updated_time.



6
7
8
# File 'lib/fb_graph/status.rb', line 6

def updated_time
  @updated_time
end