Class: LockstepSdk::BulkCurrencyConversionModel
- Inherits:
-
Object
- Object
- LockstepSdk::BulkCurrencyConversionModel
- Defined in:
- lib/lockstep_sdk/models/bulk_currency_conversion_model.rb
Overview
Input format used for bulk conversion route
Instance Attribute Summary collapse
-
#date ⇒ Date
The date for the currency rate.
-
#source_currency ⇒ String
The currency code This will be validated by the /api/v1/currencies data set.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ BulkCurrencyConversionModel
constructor
Initialize the BulkCurrencyConversionModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ BulkCurrencyConversionModel
Initialize the BulkCurrencyConversionModel using the provided prototype
28 29 30 31 |
# File 'lib/lockstep_sdk/models/bulk_currency_conversion_model.rb', line 28 def initialize(params = {}) @date = params.dig(:date) @source_currency = params.dig(:source_currency) end |
Instance Attribute Details
#date ⇒ Date
Returns The date for the currency rate.
35 36 37 |
# File 'lib/lockstep_sdk/models/bulk_currency_conversion_model.rb', line 35 def date @date end |
#source_currency ⇒ String
Returns The currency code This will be validated by the /api/v1/currencies data set.
39 40 41 |
# File 'lib/lockstep_sdk/models/bulk_currency_conversion_model.rb', line 39 def source_currency @source_currency end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
43 44 45 46 47 48 |
# File 'lib/lockstep_sdk/models/bulk_currency_conversion_model.rb', line 43 def as_json(={}) { 'date' => @date, 'sourceCurrency' => @source_currency, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
52 53 54 |
# File 'lib/lockstep_sdk/models/bulk_currency_conversion_model.rb', line 52 def to_json(*) "[#{as_json(*).to_json(*)}]" end |