Class: Adhearsion::Rayo::CommandNode

Inherits:
RayoNode show all
Defined in:
lib/adhearsion/rayo/command_node.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, #inherit, #inspect, #rayo_attributes, #rayo_children, register, #source, #to_rayo, #to_xml

Constructor Details

#initialize(*args) ⇒ CommandNode

Returns a new instance of CommandNode.



13
14
15
16
# File 'lib/adhearsion/rayo/command_node.rb', line 13

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

Instance Method Details

#response(timeout = nil) ⇒ Object



32
33
34
# File 'lib/adhearsion/rayo/command_node.rb', line 32

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

#response=(other) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/adhearsion/rayo/command_node.rb', line 36

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