Class: Plivo::Parameter
- Inherits:
-
Object
- Object
- Plivo::Parameter
- Defined in:
- lib/plivo/template.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#date_time ⇒ Object
Returns the value of attribute date_time.
-
#media ⇒ Object
Returns the value of attribute media.
-
#text ⇒ Object
Returns the value of attribute text.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type: nil, text: nil, media: nil, currency: nil, date_time: nil) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_hash ⇒ Object
Constructor Details
#initialize(type: nil, text: nil, media: nil, currency: nil, date_time: nil) ⇒ Parameter
Returns a new instance of Parameter.
46 47 48 49 50 51 52 |
# File 'lib/plivo/template.rb', line 46 def initialize(type: nil, text: nil, media: nil, currency: nil, date_time: nil) @type = type @text = text @media = media @currency = currency @date_time = date_time end |
Instance Attribute Details
#currency ⇒ Object
Returns the value of attribute currency.
44 45 46 |
# File 'lib/plivo/template.rb', line 44 def currency @currency end |
#date_time ⇒ Object
Returns the value of attribute date_time.
44 45 46 |
# File 'lib/plivo/template.rb', line 44 def date_time @date_time end |
#media ⇒ Object
Returns the value of attribute media.
44 45 46 |
# File 'lib/plivo/template.rb', line 44 def media @media end |
#text ⇒ Object
Returns the value of attribute text.
44 45 46 |
# File 'lib/plivo/template.rb', line 44 def text @text end |
#type ⇒ Object
Returns the value of attribute type.
44 45 46 |
# File 'lib/plivo/template.rb', line 44 def type @type end |
Instance Method Details
#to_hash ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/plivo/template.rb', line 54 def to_hash { type: @type, text: @text, media: @media, currency: @currency&.to_hash, date_time: @date_time&.to_hash }.reject { |_, v| v.nil? } end |