Class: Punchblock::CommandNode

Inherits:
RayoNode show all
Defined in:
lib/punchblock/command_node.rb

Direct Known Subclasses

Punchblock::Command::Accept, Punchblock::Command::Answer, Punchblock::Command::Dial, Punchblock::Command::Hangup, Punchblock::Command::Join, Punchblock::Command::Mute, Punchblock::Command::Redirect, Punchblock::Command::Reject, Punchblock::Command::Unjoin, Punchblock::Command::Unmute, Punchblock::Component::ComponentNode, Punchblock::Component::Output::Pause, Punchblock::Component::Output::Resume, Punchblock::Component::Output::Seek, Punchblock::Component::Output::SlowDown, Punchblock::Component::Output::SpeedUp, Punchblock::Component::Output::VolumeDown, Punchblock::Component::Output::VolumeUp, Punchblock::Component::Record::Pause, Punchblock::Component::Record::Resume, Punchblock::Component::Stop

Instance Attribute Summary

Attributes inherited from RayoNode

#client, #connection, #original_component

Instance Method Summary (collapse)

Methods inherited from RayoNode

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

Constructor Details

- (CommandNode) initialize(*args)

Returns a new instance of CommandNode



9
10
11
12
# File 'lib/punchblock/command_node.rb', line 9

def initialize(*args)
  super
  @response = FutureResource.new
end

Instance Method Details

- (Object) response(timeout = nil)



28
29
30
# File 'lib/punchblock/command_node.rb', line 28

def response(timeout = nil)
  @response.resource timeout
end

- (Object) response=(other)



32
33
34
35
36
37
38
39
40
# File 'lib/punchblock/command_node.rb', line 32

def response=(other)
  return if @response.set_yet?
  @response.resource = other
  execute!
rescue StateMachine::InvalidTransition => e
  e.message << " for command #{self}"
  raise e
rescue FutureResource::ResourceAlreadySetException
end