Class: Btce::Types::PlacedOrder

Inherits:
Object
  • Object
show all
Defined in:
lib/btce/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (readonly)

Returns the value of attribute order_id.



131
132
133
# File 'lib/btce/types.rb', line 131

def order_id
  @order_id
end

#receivedObject (readonly)

Returns the value of attribute received.



131
132
133
# File 'lib/btce/types.rb', line 131

def received
  @received
end

#remainsObject (readonly)

Returns the value of attribute remains.



131
132
133
# File 'lib/btce/types.rb', line 131

def remains
  @remains
end

Instance Method Details

#cancelObject



140
141
142
# File 'lib/btce/types.rb', line 140

def cancel
  @api.cancel_order @values[:order_id]
end

#to_sObject



144
145
146
# File 'lib/btce/types.rb', line 144

def to_s
  @values.to_s
end