Class: Punchblock::Event::Asterisk::AMI::Event

Inherits:
Punchblock::Event show all
Defined in:
lib/punchblock/event/asterisk/ami/event.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, register, #source, #to_rayo, #to_xml

Instance Method Details

- (Object) inherit(xml_node)



15
16
17
18
19
20
# File 'lib/punchblock/event/asterisk/ami/event.rb', line 15

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

- (Object) rayo_attributes



22
23
24
# File 'lib/punchblock/event/asterisk/ami/event.rb', line 22

def rayo_attributes
  {'name' => name}
end

- (Object) rayo_children(root)



26
27
28
29
30
31
# File 'lib/punchblock/event/asterisk/ami/event.rb', line 26

def rayo_children(root)
  super
  headers.each do |name, value|
    root.attribute name: name, value: value
  end
end