Class: WhatsappSdk::Resource::Currency
- Inherits:
-
Object
- Object
- WhatsappSdk::Resource::Currency
- Defined in:
- lib/whatsapp_sdk/resource/currency.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Amount multiplied by 1000.
-
#code ⇒ Object
Currency code as defined in ISO 4217.
-
#fallback_value ⇒ Object
Returns default text if localization fails.
Instance Method Summary collapse
-
#initialize(fallback_value:, code:, amount:) ⇒ Currency
constructor
A new instance of Currency.
- #to_json ⇒ Object
Constructor Details
#initialize(fallback_value:, code:, amount:) ⇒ Currency
Returns a new instance of Currency.
21 22 23 24 25 |
# File 'lib/whatsapp_sdk/resource/currency.rb', line 21 def initialize(fallback_value:, code:, amount:) @fallback_value = fallback_value @code = code @amount = amount end |
Instance Attribute Details
#amount ⇒ Object
Amount multiplied by 1000.
19 20 21 |
# File 'lib/whatsapp_sdk/resource/currency.rb', line 19 def amount @amount end |
#code ⇒ Object
Currency code as defined in ISO 4217.
14 15 16 |
# File 'lib/whatsapp_sdk/resource/currency.rb', line 14 def code @code end |
#fallback_value ⇒ Object
Returns default text if localization fails.
9 10 11 |
# File 'lib/whatsapp_sdk/resource/currency.rb', line 9 def fallback_value @fallback_value end |
Instance Method Details
#to_json ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/whatsapp_sdk/resource/currency.rb', line 27 def to_json { fallback_value: fallback_value, code: code, amount_1000: amount } end |