Module: OpenExchangeRates::Client::Connections
- Included in:
- OpenExchangeRates::Client
- Defined in:
- lib/open_exchange_rates/client/connections.rb
Instance Method Summary collapse
- #get(path, options = {}) ⇒ Object
- #parse_rates(data) ⇒ Object
- #request(http_method, path, options) ⇒ Object
Instance Method Details
#get(path, options = {}) ⇒ Object
4 5 6 |
# File 'lib/open_exchange_rates/client/connections.rb', line 4 def get(path, = {}) request :get, path, end |
#parse_rates(data) ⇒ Object
14 15 16 |
# File 'lib/open_exchange_rates/client/connections.rb', line 14 def parse_rates(data) data['rates'] end |
#request(http_method, path, options) ⇒ Object
8 9 10 11 12 |
# File 'lib/open_exchange_rates/client/connections.rb', line 8 def request(http_method, path, ) response = self.class.send http_method, path, { query: } data = response.parsed_response parse_rates data end |