Class: Punchblock::Component::Asterisk::AGI::Command
- Inherits:
-
ComponentNode
- Object
- Niceogiri::XML::Node
- RayoNode
- Punchblock::CommandNode
- ComponentNode
- Punchblock::Component::Asterisk::AGI::Command
- Defined in:
- lib/punchblock/component/asterisk/agi/command.rb
Defined Under Namespace
Constant Summary
Constants inherited from RayoNode
Instance Attribute Summary
Attributes inherited from RayoNode
#client, #component_id, #connection, #domain, #original_component, #target_call_id, #target_mixer_name
Class Method Summary collapse
Instance Method Summary collapse
-
#inspect_attributes ⇒ Object
:nodoc:.
- #name ⇒ Object
- #name=(other) ⇒ Object
-
#params ⇒ Array[Param]
Params.
- #params=(params) ⇒ Object
-
#params_array ⇒ Array[String]
Array of values of params.
Methods inherited from ComponentNode
#add_event, #complete_event, #complete_event=, #initialize, #register_event_handler, #register_internal_handlers, #response=, #stop!, #stop_action, #trigger_event_handler, #write_action
Methods inherited from Punchblock::CommandNode
#initialize, #response, #response=, #write_attr
Methods inherited from RayoNode
class_from_registration, #eql?, import, #inspect, register, #source
Constructor Details
This class inherits a constructor from Punchblock::Component::ComponentNode
Class Method Details
.new(options = {}) ⇒ Object
10 11 12 13 14 |
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 10 def self.new( = {}) super().tap do |new_node| .each_pair { |k,v| new_node.send :"#{k}=", v } end end |
Instance Method Details
#inspect_attributes ⇒ Object
:nodoc:
48 49 50 |
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 48 def inspect_attributes # :nodoc: [:name, :params_array] + super end |
#name ⇒ Object
16 17 18 |
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 16 def name read_attr :name end |
#name=(other) ⇒ Object
20 21 22 |
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 20 def name=(other) write_attr :name, other end |
#params ⇒ Array[Param]
Returns params.
34 35 36 37 38 |
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 34 def params find('//ns:param', :ns => self.class.registered_ns).map do |i| Param.new i end end |
#params=(params) ⇒ Object
43 44 45 46 |
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 43 def params=(params) find('//ns:param', :ns => self.class.registered_ns).each(&:remove) [params].flatten.each { |i| self << Param.new(i) } if params.is_a? Array end |
#params_array ⇒ Array[String]
Returns array of values of params.
27 28 29 |
# File 'lib/punchblock/component/asterisk/agi/command.rb', line 27 def params_array params.map(&:value) end |