Class: CurrencyExchange::Transporters::JsonTransporter

Inherits:
ExchangeTransporter show all
Defined in:
lib/currency_exchange/transporters/json_transporter.rb

Constant Summary

Constants inherited from ExchangeTransporter

ExchangeTransporter::TRANSPORTER_STRATEGY

Instance Method Summary collapse

Methods inherited from ExchangeTransporter

#initialize, load_instance, #retrieve_rates

Constructor Details

This class inherits a constructor from CurrencyExchange::Transporters::ExchangeTransporter

Instance Method Details

#fetch_data(url) ⇒ Object



12
13
14
15
# File 'lib/currency_exchange/transporters/json_transporter.rb', line 12

def fetch_data(url)
  response = RestClient.get(url, {:accept => :json})
  JSON.parse(response.body)
end