Class: ECBExchangeRatesApi::Options
- Inherits:
-
Object
- Object
- ECBExchangeRatesApi::Options
- Includes:
- SharedMethods
- Defined in:
- lib/ecb_exchange_rates_api/options.rb
Overview
Presents API params
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#end_at ⇒ Object
readonly
Returns the value of attribute end_at.
-
#specific_date ⇒ Object
readonly
Returns the value of attribute specific_date.
-
#start_at ⇒ Object
readonly
Returns the value of attribute start_at.
-
#symbols ⇒ Object
readonly
Returns the value of attribute symbols.
Instance Method Summary collapse
- #append_symbol(code) ⇒ Object
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #to_params ⇒ Object
Methods included from SharedMethods
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
15 16 17 18 19 20 21 |
# File 'lib/ecb_exchange_rates_api/options.rb', line 15 def initialize @start_at = nil @end_at = nil @specific_date = nil @base = nil @symbols = [] end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
10 11 12 |
# File 'lib/ecb_exchange_rates_api/options.rb', line 10 def base @base end |
#end_at ⇒ Object (readonly)
Returns the value of attribute end_at.
10 11 12 |
# File 'lib/ecb_exchange_rates_api/options.rb', line 10 def end_at @end_at end |
#specific_date ⇒ Object (readonly)
Returns the value of attribute specific_date.
10 11 12 |
# File 'lib/ecb_exchange_rates_api/options.rb', line 10 def specific_date @specific_date end |
#start_at ⇒ Object (readonly)
Returns the value of attribute start_at.
10 11 12 |
# File 'lib/ecb_exchange_rates_api/options.rb', line 10 def start_at @start_at end |
#symbols ⇒ Object (readonly)
Returns the value of attribute symbols.
10 11 12 |
# File 'lib/ecb_exchange_rates_api/options.rb', line 10 def symbols @symbols end |
Instance Method Details
#append_symbol(code) ⇒ Object
23 24 25 |
# File 'lib/ecb_exchange_rates_api/options.rb', line 23 def append_symbol(code) @symbols << validated_currency_code(code) end |
#to_params ⇒ Object
27 28 29 |
# File 'lib/ecb_exchange_rates_api/options.rb', line 27 def to_params .reject { |_, val| val.nil? || val.empty? } end |