Class: Punchblock::Event::Complete

Inherits:
Punchblock::Event show all
Defined in:
lib/punchblock/event/complete.rb

Defined Under Namespace

Classes: Error, Hangup, Reason, Stop

Instance Attribute Summary

Attributes inherited from RayoNode

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

Instance Method Summary collapse

Methods inherited from RayoNode

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

Instance Method Details

#inspect_attributesObject

:nodoc:



30
31
32
# File 'lib/punchblock/event/complete.rb', line 30

def inspect_attributes # :nodoc:
  [:reason, :recording] + super
end

#reasonObject



10
11
12
13
14
15
16
17
18
# File 'lib/punchblock/event/complete.rb', line 10

def reason
  element = find_first('*')
  if element
    RayoNode.import(element).tap do |reason|
      reason.call_id = call_id
      reason.component_id = component_id
    end
  end
end

#recordingObject



20
21
22
23
24
25
26
27
28
# File 'lib/punchblock/event/complete.rb', line 20

def recording
  element = find_first('//ns:recording', :ns => RAYO_NAMESPACES[:record_complete])
  if element
    RayoNode.import(element).tap do |recording|
      recording.call_id = call_id
      recording.component_id = component_id
    end
  end
end