Class: Straight::ExchangeRate::LocalbitcoinsAdapter

Inherits:
Adapter
  • Object
show all
Defined in:
lib/straight/exchange_rate_adapters/localbitcoins_adapter.rb

Constant Summary collapse

FETCH_URL =
'https://localbitcoins.com/bitcoinaverage/ticker-all-currencies/'

Instance Method Summary collapse

Methods inherited from Adapter

#convert_from_currency, #convert_to_currency, #fetch_rates!, #get_rate_value_from_hash, #initialize, #rate_to_f

Constructor Details

This class inherits a constructor from Straight::ExchangeRate::Adapter

Instance Method Details

#rate_for(currency_code) ⇒ Object



8
9
10
11
12
# File 'lib/straight/exchange_rate_adapters/localbitcoins_adapter.rb', line 8

def rate_for(currency_code)
  super
  rate = get_rate_value_from_hash(@rates, currency_code.upcase, 'rates', 'last')
  rate_to_f(rate)
end