Class: BitfinexOrder
- Inherits:
-
Object
- Object
- BitfinexOrder
- Defined in:
- lib/bitex_bot/models/bitfinex_api_wrapper.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#datetime ⇒ Object
Returns the value of attribute datetime.
-
#id ⇒ Object
Returns the value of attribute id.
-
#price ⇒ Object
Returns the value of attribute price.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #cancel! ⇒ Object
-
#initialize(order_data) ⇒ BitfinexOrder
constructor
A new instance of BitfinexOrder.
Constructor Details
#initialize(order_data) ⇒ BitfinexOrder
Returns a new instance of BitfinexOrder.
91 92 93 94 95 96 97 |
# File 'lib/bitex_bot/models/bitfinex_api_wrapper.rb', line 91 def initialize(order_data) self.id = order_data['id'].to_i self.amount = order_data['original_amount'].to_d self.price = order_data['price'].to_d self.type = order_data['side'].to_sym self.datetime = order_data['timestamp'].to_i end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
90 91 92 |
# File 'lib/bitex_bot/models/bitfinex_api_wrapper.rb', line 90 def amount @amount end |
#datetime ⇒ Object
Returns the value of attribute datetime.
90 91 92 |
# File 'lib/bitex_bot/models/bitfinex_api_wrapper.rb', line 90 def datetime @datetime end |
#id ⇒ Object
Returns the value of attribute id.
90 91 92 |
# File 'lib/bitex_bot/models/bitfinex_api_wrapper.rb', line 90 def id @id end |
#price ⇒ Object
Returns the value of attribute price.
90 91 92 |
# File 'lib/bitex_bot/models/bitfinex_api_wrapper.rb', line 90 def price @price end |
#type ⇒ Object
Returns the value of attribute type.
90 91 92 |
# File 'lib/bitex_bot/models/bitfinex_api_wrapper.rb', line 90 def type @type end |
Instance Method Details
#cancel! ⇒ Object
99 100 101 |
# File 'lib/bitex_bot/models/bitfinex_api_wrapper.rb', line 99 def cancel! Bitfinex::Client.new.cancel_orders(id) end |