Class: BankExchangeApi::Request::Rate

Inherits:
Base
  • Object
show all
Defined in:
lib/bank_exchange_api/request/rate.rb

Instance Attribute Summary

Attributes inherited from Base

#cli

Instance Method Summary collapse

Methods inherited from Base

#get, #initialize, #query

Methods included from Param

#param

Constructor Details

This class inherits a constructor from BankExchangeApi::Request::Base

Instance Method Details

#endpointObject



21
22
23
# File 'lib/bank_exchange_api/request/rate.rb', line 21

def endpoint
  "/rates/#{iso_code!}"
end

#jsonObject



8
9
10
# File 'lib/bank_exchange_api/request/rate.rb', line 8

def json
  super(root: :rates)
end

#paramsObject



12
13
14
15
16
17
18
19
# File 'lib/bank_exchange_api/request/rate.rb', line 12

def params
  {
      date: date,
      iso_from: iso_from.join(','),
      iso_to: iso_to.join(','),
      fallback_days: fallback_days
  }
end