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.
-
#location ⇒ Object
Returns the value of attribute location.
-
#media ⇒ Object
Returns the value of attribute media.
-
#parameter_name ⇒ Object
Returns the value of attribute parameter_name.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#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, payload: nil, currency: nil, date_time: nil, location: nil, parameter_name: nil) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_hash ⇒ Object
Constructor Details
#initialize(type: nil, text: nil, media: nil, payload: nil, currency: nil, date_time: nil, location: nil, parameter_name: nil) ⇒ Parameter
Returns a new instance of Parameter.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/plivo/template.rb', line 47 def initialize(type: nil, text: nil, media: nil, payload: nil, currency: nil, date_time: nil, location: nil, parameter_name: nil) @type = type @text = text @media = media @payload = payload @currency = currency @date_time = date_time @location = location @parameter_name = parameter_name end |
Instance Attribute Details
#currency ⇒ Object
Returns the value of attribute currency.
45 46 47 |
# File 'lib/plivo/template.rb', line 45 def currency @currency end |
#date_time ⇒ Object
Returns the value of attribute date_time.
45 46 47 |
# File 'lib/plivo/template.rb', line 45 def date_time @date_time end |
#location ⇒ Object
Returns the value of attribute location.
45 46 47 |
# File 'lib/plivo/template.rb', line 45 def location @location end |
#media ⇒ Object
Returns the value of attribute media.
45 46 47 |
# File 'lib/plivo/template.rb', line 45 def media @media end |
#parameter_name ⇒ Object
Returns the value of attribute parameter_name.
45 46 47 |
# File 'lib/plivo/template.rb', line 45 def parameter_name @parameter_name end |
#payload ⇒ Object
Returns the value of attribute payload.
45 46 47 |
# File 'lib/plivo/template.rb', line 45 def payload @payload end |
#text ⇒ Object
Returns the value of attribute text.
45 46 47 |
# File 'lib/plivo/template.rb', line 45 def text @text end |
#type ⇒ Object
Returns the value of attribute type.
45 46 47 |
# File 'lib/plivo/template.rb', line 45 def type @type end |
Instance Method Details
#to_hash ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/plivo/template.rb', line 58 def to_hash { type: @type, text: @text, media: @media, payload: @payload, currency: @currency&.to_hash, date_time: @date_time&.to_hash, location: @location&.to_hash, parameter_name: @parameter_name }.reject { |_, v| v.nil? } end |