Class: FXRates::Request
- Inherits:
-
Object
- Object
- FXRates::Request
- Defined in:
- lib/fx_rates/request.rb
Constant Summary collapse
- BASE_URL =
"https://api.fxratesapi.com"
Instance Method Summary collapse
- #get(path, params = {}) ⇒ Object
-
#initialize(api_key) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(api_key) ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 |
# File 'lib/fx_rates/request.rb', line 8 def initialize(api_key) raise FXRates::AuthenticationError, "API key is required" if api_key.nil? @api_key = api_key end |
Instance Method Details
#get(path, params = {}) ⇒ Object
14 15 16 17 |
# File 'lib/fx_rates/request.rb', line 14 def get(path, params = {}) response = connection.get(path, params) handle_response(response) end |