Class: Punchblock::CommandNode
- 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, Punchblock::Component::Tropo::Conference::Kick, Punchblock::Component::Tropo::Say::Pause, Punchblock::Component::Tropo::Say::Resume
Instance Attribute Summary
Attributes inherited from RayoNode
#call_id, #client, #component_id, #connection, #original_component
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ CommandNode
constructor
A new instance of CommandNode.
- #response(timeout = nil) ⇒ Object
- #response=(other) ⇒ Object
- #write_attr(*args) ⇒ Object
Methods inherited from RayoNode
class_from_registration, #eql?, import, #inspect, #inspect_attributes, register, #source
Constructor Details
#initialize(*args) ⇒ CommandNode
Returns a new instance of CommandNode.
12 13 14 15 |
# File 'lib/punchblock/command_node.rb', line 12 def initialize(*args) super @response = FutureResource.new end |
Class Method Details
.new(options = {}) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/punchblock/command_node.rb', line 5 def self.new( = {}) super().tap do |new_node| new_node.call_id = [:call_id] new_node.component_id = [:component_id] end end |
Instance Method Details
#response(timeout = nil) ⇒ Object
36 37 38 |
# File 'lib/punchblock/command_node.rb', line 36 def response(timeout = nil) @response.resource timeout end |
#response=(other) ⇒ Object
40 41 42 43 44 |
# File 'lib/punchblock/command_node.rb', line 40 def response=(other) return if @response.set_yet? @response.resource = other execute! end |
#write_attr(*args) ⇒ Object
31 32 33 34 |
# File 'lib/punchblock/command_node.rb', line 31 def write_attr(*args) raise StandardError, "Cannot alter attributes of a requested command" unless new? super end |