Class: Punchblock::MediaNode

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

Constant Summary

Constants inherited from RayoNode

RayoNode::InvalidNodeError

Instance Attribute Summary

Attributes inherited from RayoNode

#client, #component_id, #connection, #domain, #original_component, #target_call_id, #target_mixer_name

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



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

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