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.



68
69
70
71
72
# File 'lib/plivo/template.rb', line 68

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.



66
67
68
# File 'lib/plivo/template.rb', line 66

def amount_1000
  @amount_1000
end

#currency_codeObject

Returns the value of attribute currency_code.



66
67
68
# File 'lib/plivo/template.rb', line 66

def currency_code
  @currency_code
end

#fallback_valueObject

Returns the value of attribute fallback_value.



66
67
68
# File 'lib/plivo/template.rb', line 66

def fallback_value
  @fallback_value
end

Instance Method Details

#to_hashObject



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

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