Class: Excoin::Market::Exchange::Order
- Inherits:
-
Object
- Object
- Excoin::Market::Exchange::Order
- Defined in:
- lib/exchange/order.rb
Instance Attribute Summary collapse
-
#commodity ⇒ Object
readonly
Returns the value of attribute commodity.
-
#commodity_amount ⇒ Object
readonly
Returns the value of attribute commodity_amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#currency_amount ⇒ Object
readonly
Returns the value of attribute currency_amount.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #exchange ⇒ Object
-
#initialize(order_data) ⇒ Order
constructor
A new instance of Order.
Constructor Details
#initialize(order_data) ⇒ Order
Returns a new instance of Order.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/exchange/order.rb', line 5 def initialize(order_data) begin @currency = order_data['currency'] @commodity = order_data['commodity'] @type = order_data['type'] @price = BigDecimal.new(order_data['price']) @commodity_amount = BigDecimal.new(order_data['commodity_amount']) @currency_amount = BigDecimal.new(order_data['currency_amount']) rescue puts "Error in Excoin::Market::Exchange::Order.initialize" puts order_data end end |
Instance Attribute Details
#commodity ⇒ Object (readonly)
Returns the value of attribute commodity.
2 3 4 |
# File 'lib/exchange/order.rb', line 2 def commodity @commodity end |
#commodity_amount ⇒ Object (readonly)
Returns the value of attribute commodity_amount.
2 3 4 |
# File 'lib/exchange/order.rb', line 2 def commodity_amount @commodity_amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
2 3 4 |
# File 'lib/exchange/order.rb', line 2 def currency @currency end |
#currency_amount ⇒ Object (readonly)
Returns the value of attribute currency_amount.
2 3 4 |
# File 'lib/exchange/order.rb', line 2 def currency_amount @currency_amount end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
2 3 4 |
# File 'lib/exchange/order.rb', line 2 def price @price end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
2 3 4 |
# File 'lib/exchange/order.rb', line 2 def type @type end |