Class: Plivo::Currency

Inherits:
Object
  • Object
show all
Defined in:
lib/plivo/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fallback_value: nil, currency_code: nil, amount_1000: nil) ⇒ Currency

Returns a new instance of Currency.



75
76
77
78
79
# File 'lib/plivo/template.rb', line 75

def initialize(fallback_value: nil, currency_code: nil, amount_1000: nil)
  @fallback_value = fallback_value
  @currency_code = currency_code
  @amount_1000 = amount_1000
end

Instance Attribute Details

#amount_1000Object

Returns the value of attribute amount_1000.



73
74
75
# File 'lib/plivo/template.rb', line 73

def amount_1000
  @amount_1000
end

#currency_codeObject

Returns the value of attribute currency_code.



73
74
75
# File 'lib/plivo/template.rb', line 73

def currency_code
  @currency_code
end

#fallback_valueObject

Returns the value of attribute fallback_value.



73
74
75
# File 'lib/plivo/template.rb', line 73

def fallback_value
  @fallback_value
end

Instance Method Details

#to_hashObject



81
82
83
84
85
86
87
# File 'lib/plivo/template.rb', line 81

def to_hash
  {
    fallback_value: @fallback_value,
    currency_code: @currency_code,
    amount_1000: @amount_1000
  }.reject { |_, v| v.nil? }
end