Class: MtGox::OrderResult
- Inherits:
-
Object
- Object
- MtGox::OrderResult
show all
- Includes:
- Value
- Defined in:
- lib/mtgox/order_result.rb
Constant Summary
Constants included
from Value
Value::INT_MULTIPLIERS
Instance Method Summary
collapse
Methods included from Value
#decimalify, #intify, #value_bitcoin, #value_currency
Constructor Details
Returns a new instance of OrderResult.
5
6
7
|
# File 'lib/mtgox/order_result.rb', line 5
def initialize(json)
@json = json
end
|
Instance Method Details
#avg_cost ⇒ Object
25
26
27
|
# File 'lib/mtgox/order_result.rb', line 25
def avg_cost
to_decimal "avg_cost", @json
end
|
#id ⇒ Object
9
10
11
|
# File 'lib/mtgox/order_result.rb', line 9
def id
@json["order_id"]
end
|
#total_amount ⇒ Object
21
22
23
|
# File 'lib/mtgox/order_result.rb', line 21
def total_amount
to_decimal "total_amount", @json
end
|
#total_spent ⇒ Object
17
18
19
|
# File 'lib/mtgox/order_result.rb', line 17
def total_spent
to_decimal "total_spent", @json
end
|
#trades ⇒ Object
13
14
15
|
# File 'lib/mtgox/order_result.rb', line 13
def trades
@json["trades"].map{|t| Trade.new(coerce_trade(t)) }
end
|