Class: LockstepSdk::CurrencyModel
- Inherits:
-
Object
- Object
- LockstepSdk::CurrencyModel
- Defined in:
- lib/lockstep_sdk/models/currency_model.rb
Overview
Represents an ISO-4217 currency code definition
Instance Attribute Summary collapse
-
#alpha_code ⇒ String
Alphabetic code for the given currency.
-
#currency_name ⇒ String
Name of currency.
-
#minor_unit ⇒ Int32
Number of places after the decimal for this currency.
-
#numeric_code ⇒ String
Numeric code for the given currency.
-
#symbol ⇒ String
Symbol for the given currency.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ CurrencyModel
constructor
Initialize the CurrencyModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ CurrencyModel
Initialize the CurrencyModel using the provided prototype
28 29 30 31 32 33 34 |
# File 'lib/lockstep_sdk/models/currency_model.rb', line 28 def initialize(params = {}) @alpha_code = params.dig(:alpha_code) @numeric_code = params.dig(:numeric_code) @currency_name = params.dig(:currency_name) @minor_unit = params.dig(:minor_unit) @symbol = params.dig(:symbol) end |
Instance Attribute Details
#alpha_code ⇒ String
Returns Alphabetic code for the given currency.
38 39 40 |
# File 'lib/lockstep_sdk/models/currency_model.rb', line 38 def alpha_code @alpha_code end |
#currency_name ⇒ String
Returns Name of currency.
46 47 48 |
# File 'lib/lockstep_sdk/models/currency_model.rb', line 46 def currency_name @currency_name end |
#minor_unit ⇒ Int32
Returns Number of places after the decimal for this currency.
50 51 52 |
# File 'lib/lockstep_sdk/models/currency_model.rb', line 50 def minor_unit @minor_unit end |
#numeric_code ⇒ String
Returns Numeric code for the given currency.
42 43 44 |
# File 'lib/lockstep_sdk/models/currency_model.rb', line 42 def numeric_code @numeric_code end |
#symbol ⇒ String
Returns Symbol for the given currency.
54 55 56 |
# File 'lib/lockstep_sdk/models/currency_model.rb', line 54 def symbol @symbol end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
58 59 60 61 62 63 64 65 66 |
# File 'lib/lockstep_sdk/models/currency_model.rb', line 58 def as_json(={}) { 'alphaCode' => @alpha_code, 'numericCode' => @numeric_code, 'currencyName' => @currency_name, 'minorUnit' => @minor_unit, 'symbol' => @symbol, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
70 71 72 |
# File 'lib/lockstep_sdk/models/currency_model.rb', line 70 def to_json(*) "[#{as_json(*).to_json(*)}]" end |