Class: ChinaShop::Order

Inherits:
Object
  • Object
show all
Defined in:
lib/chinashop/order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order = {}) ⇒ Order

Returns a new instance of Order.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/chinashop/order.rb', line 5

def initialize(order = {})
  self.all      = order['result']['order']
  self.id       = order['result']['order']['id']
  self.type     = order['result']['order']['type']
  self.price    = order['result']['order']['price']
  self.currency = order['result']['order']['currency']
  self.amount   = order['result']['order']['amount']
  self.amount_original = order['result']['order']['amount_original']
  self.date     = order['result']['order']['date']
  self.status   = order['result']['order']['status']
end

Instance Attribute Details

#allObject

Returns the value of attribute all.



3
4
5
# File 'lib/chinashop/order.rb', line 3

def all
  @all
end

#amountObject

Returns the value of attribute amount.



3
4
5
# File 'lib/chinashop/order.rb', line 3

def amount
  @amount
end

#amount_originalObject

Returns the value of attribute amount_original.



3
4
5
# File 'lib/chinashop/order.rb', line 3

def amount_original
  @amount_original
end

#currencyObject

Returns the value of attribute currency.



3
4
5
# File 'lib/chinashop/order.rb', line 3

def currency
  @currency
end

#dateObject

Returns the value of attribute date.



3
4
5
# File 'lib/chinashop/order.rb', line 3

def date
  @date
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/chinashop/order.rb', line 3

def id
  @id
end

#priceObject

Returns the value of attribute price.



3
4
5
# File 'lib/chinashop/order.rb', line 3

def price
  @price
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/chinashop/order.rb', line 3

def status
  @status
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/chinashop/order.rb', line 3

def type
  @type
end