Class: Bitbot::Trader::Providers::MtGox::AccountInfoParser
- Inherits:
-
Object
- Object
- Bitbot::Trader::Providers::MtGox::AccountInfoParser
- Defined in:
- lib/bitbot/trader/providers/mt_gox/account_info_parser.rb
Overview
Parses raw open orders
Class Method Summary collapse
-
.parse_wallets(raw_wallets) ⇒ Array<Hash>
private
Parses raw wallets.
Instance Method Summary collapse
-
#parse ⇒ Account
private
Makes raw account info hash into Account object.
Class Method Details
.parse_wallets(raw_wallets) ⇒ Array<Hash>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parses raw wallets
36 37 38 39 40 |
# File 'lib/bitbot/trader/providers/mt_gox/account_info_parser.rb', line 36 def self.parse_wallets(raw_wallets) raw_wallets.map { |_key, raw_wallet| ValueWithCurrencyCoercer.call(raw_wallet["Balance"]) } end |
Instance Method Details
#parse ⇒ Account
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Makes raw account info hash into Account object
19 20 21 22 23 24 25 26 |
# File 'lib/bitbot/trader/providers/mt_gox/account_info_parser.rb', line 19 def parse parsed = attributes Account.new( fee: parsed[:Trade_Fee], wallets: self.class.parse_wallets(parsed[:Wallets]) ) end |