Class: Punchblock::MediaNode

Inherits:
RayoNode
  • Object
show all
Includes:
MediaContainer
Defined in:
lib/punchblock/media_node.rb

Instance Attribute Summary

Attributes inherited from RayoNode

#call_id, #client, #component_id, #connection, #original_component

Class Method Summary collapse

Methods included from MediaContainer

#inspect_attributes, #ssml, #ssml=, #voice, #voice=

Methods inherited from RayoNode

class_from_registration, #eql?, import, #inspect, #inspect_attributes, register, #source

Class Method Details

.new(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/punchblock/media_node.rb', line 5

def self.new(options = {})
  super().tap do |new_node|
    case options
    when Hash
      new_node << options.delete(:text) if options[:text]
      options.each_pair { |k,v| new_node.send :"#{k}=", v }
    when Nokogiri::XML::Element
      new_node.inherit options
    end
  end
end