Method: FbGraph::Order#initialize

Defined in:
lib/fb_graph/order.rb

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

Returns a new instance of Order.



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

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