Class: CurrencyLayer::LiveRequest
- Inherits:
-
Object
- Object
- CurrencyLayer::LiveRequest
- Includes:
- Hashable
- Defined in:
- lib/currency_conversion/live/live_request.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(query = {}) ⇒ LiveRequest
constructor
A new instance of LiveRequest.
Constructor Details
#initialize(query = {}) ⇒ LiveRequest
Returns a new instance of LiveRequest.
11 12 13 14 15 16 17 18 |
# File 'lib/currency_conversion/live/live_request.rb', line 11 def initialize(query = {}) # Ruby passes by reference, so we can manipulate the object, and we check if the currencies is an array, and if so, we convert to string according to API query.currencies = query.currencies.kind_of?(String) ? query.currencies : query.currencies.join(',') self.query = query end |
Instance Attribute Details
#query ⇒ Object
Returns the value of attribute query.
9 10 11 |
# File 'lib/currency_conversion/live/live_request.rb', line 9 def query @query end |