Class: Btce::Types::PlacedOrder
- Inherits:
-
Object
- Object
- Btce::Types::PlacedOrder
- Defined in:
- lib/btce/types.rb
Instance Attribute Summary collapse
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#received ⇒ Object
readonly
Returns the value of attribute received.
-
#remains ⇒ Object
readonly
Returns the value of attribute remains.
Instance Method Summary collapse
- #cancel ⇒ Object
-
#initialize(api, data) ⇒ PlacedOrder
constructor
from Response.return.
- #to_s ⇒ Object
Constructor Details
#initialize(api, data) ⇒ PlacedOrder
from Response.return
133 134 135 136 137 138 |
# File 'lib/btce/types.rb', line 133 def initialize(api, data) # from Response.return @api = api data.delete('funds') @values = data @values.each { |name, value| instance_variable_set("@#{name}", value) } end |
Instance Attribute Details
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
131 132 133 |
# File 'lib/btce/types.rb', line 131 def order_id @order_id end |
#received ⇒ Object (readonly)
Returns the value of attribute received.
131 132 133 |
# File 'lib/btce/types.rb', line 131 def received @received end |
#remains ⇒ Object (readonly)
Returns the value of attribute remains.
131 132 133 |
# File 'lib/btce/types.rb', line 131 def remains @remains end |
Instance Method Details
#cancel ⇒ Object
140 141 142 |
# File 'lib/btce/types.rb', line 140 def cancel @api.cancel_order @values[:order_id] end |
#to_s ⇒ Object
144 145 146 |
# File 'lib/btce/types.rb', line 144 def to_s @values.to_s end |