Class: Punchblock::CommandNode

Inherits:
RayoNode show all
Defined in:
lib/punchblock/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

- (CommandNode) initialize(*args)



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