Class: Moneymarket::AccountProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/moneymarket/core/account_provider.rb

Instance Method Summary collapse

Constructor Details

#initializeAccountProvider

Returns a new instance of AccountProvider.



3
4
5
# File 'lib/moneymarket/core/account_provider.rb', line 3

def initialize
  @accounts = {}
end

Instance Method Details

#account_for(_user_id, _currency) ⇒ Object



15
16
17
# File 'lib/moneymarket/core/account_provider.rb', line 15

def (_user_id, _currency)
  assert_implemented :account_for
end

#exchange_account_for(_currency) ⇒ Object



11
12
13
# File 'lib/moneymarket/core/account_provider.rb', line 11

def (_currency)
  assert_implemented :exchange_account_for
end

#preload_balances(_order) ⇒ Object



23
24
25
26
# File 'lib/moneymarket/core/account_provider.rb', line 23

def preload_balances(_order)
  _order.base_balance = fetch_balance(_order., _order.base_currency)
  _order.quote_balance = fetch_balance(_order.,  _order.quote_currency)
end

#preload_user_balances(_users, _currencies) ⇒ Object



19
20
21
# File 'lib/moneymarket/core/account_provider.rb', line 19

def preload_user_balances(_users, _currencies)
  assert_implemented :preload_user_balances
end

#resetObject



7
8
9
# File 'lib/moneymarket/core/account_provider.rb', line 7

def reset
  @accounts = {}
end