Class: Plivo::Header

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type: nil, text: nil, media: nil) ⇒ Header

Returns a new instance of Header.



29
30
31
32
33
# File 'lib/plivo/interactive.rb', line 29

def initialize(type: nil, text: nil, media: nil)
  @type = type
  @text = text
  @media = media
end

Instance Attribute Details

#mediaObject

Returns the value of attribute media.



27
28
29
# File 'lib/plivo/interactive.rb', line 27

def media
  @media
end

#textObject

Returns the value of attribute text.



27
28
29
# File 'lib/plivo/interactive.rb', line 27

def text
  @text
end

#typeObject

Returns the value of attribute type.



27
28
29
# File 'lib/plivo/interactive.rb', line 27

def type
  @type
end

Instance Method Details

#to_hashObject



35
36
37
38
39
40
41
# File 'lib/plivo/interactive.rb', line 35

def to_hash
  {
    type: @type,
    text: @text,
    media: @media
  }.reject { |_, v| v.nil? }
end