Class: Punchblock::Component::Asterisk::AMI::Action::Complete::Success

Inherits:
Event::Complete::Reason show all
Defined in:
lib/punchblock/component/asterisk/ami/action.rb

Instance Attribute Summary

Attributes inherited from RayoNode

#client, #connection, #original_component

Instance Method Summary collapse

Methods inherited from RayoNode

#==, class_from_registration, from_xml, #inspect, #rayo_attributes, #rayo_children, register, #source, #to_rayo, #to_xml

Instance Method Details

#inherit(xml_node) ⇒ Object


41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/punchblock/component/asterisk/ami/action.rb', line 41

def inherit(xml_node)
  message_node = xml_node.at_xpath 'ns:message', ns: self.class.registered_ns
  self.message = message_node.text if message_node

  text_body_node = xml_node.at_xpath 'ns:text-body', ns: self.class.registered_ns
  self.text_body = text_body_node.text if text_body_node

  xml_node.xpath('//ns:attribute', ns: self.class.registered_ns).to_a.each do |attribute|
    headers[attribute[:name]] = attribute[:value]
  end
  super
end