Class: Punchblock::Event::Complete

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

Defined Under Namespace

Classes: Error, Hangup, Reason, Stop

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

Instance Method Summary collapse

Methods inherited from Punchblock::Event

new

Methods inherited from RayoNode

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

Instance Method Details

#inspect_attributesObject

:nodoc:



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

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

#reasonObject



8
9
10
11
12
13
14
15
# File 'lib/punchblock/event/complete.rb', line 8

def reason
  element = find_first '*'
  return unless element
  RayoNode.import(element).tap do |reason|
    reason.target_call_id = target_call_id
    reason.component_id = component_id
  end
end

#reason=(other) ⇒ Object



17
18
19
20
# File 'lib/punchblock/event/complete.rb', line 17

def reason=(other)
  children.map(&:remove)
  self << other
end

#recordingObject



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

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