Class: FbGraph::AppRequest

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

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier, #raw_attributes

Instance Method Summary collapse

Methods inherited from Node

#connection, #destroy, fetch, #fetch, #update

Methods included from Comparison

#==

Constructor Details

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

Returns a new instance of AppRequest.



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

def initialize(identifier, attributes = {})
  super
  @data = attributes[:data]
  @message = attributes[:message]
  if attributes[:from]
    @from = User.new(attributes[:from][:id], attributes[:from])
  end
  if attributes[:to]
    @to = User.new(attributes[:to][:id], attributes[:to])
  end
  if attributes[:application]
    @application = Application.new(attributes[:application][:id], attributes[:application])
  end
  if attributes[:created_time]
    @created_time = Time.parse(attributes[:created_time]).utc
  end
end

Instance Attribute Details

#applicationObject

Returns the value of attribute application.



4
5
6
# File 'lib/fb_graph/app_request.rb', line 4

def application
  @application
end

#created_timeObject

Returns the value of attribute created_time.



4
5
6
# File 'lib/fb_graph/app_request.rb', line 4

def created_time
  @created_time
end

#dataObject

Returns the value of attribute data.



4
5
6
# File 'lib/fb_graph/app_request.rb', line 4

def data
  @data
end

#fromObject

Returns the value of attribute from.



4
5
6
# File 'lib/fb_graph/app_request.rb', line 4

def from
  @from
end

#messageObject

Returns the value of attribute message.



4
5
6
# File 'lib/fb_graph/app_request.rb', line 4

def message
  @message
end

#toObject

Returns the value of attribute to.



4
5
6
# File 'lib/fb_graph/app_request.rb', line 4

def to
  @to
end