Class: Bitbot::Trader::Providers::MtGox::AccountInfoParser

Inherits:
Object
  • Object
show all
Defined in:
lib/bitbot/trader/providers/mt_gox/account_info_parser.rb

Overview

Parses raw open orders

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • raw_wallets (Hash<String, Hash>)

Returns:

  • (Array<Hash>)


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

#parseAccount

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

Returns:



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