Class: Punchblock::Translator::Asterisk::Component::Asterisk::AMIAction
- Defined in:
- lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#translator ⇒ Object
readonly
Returns the value of attribute translator.
Attributes inherited from Component
#call, #call_id, #id, #internal
Instance Method Summary collapse
- #execute ⇒ Object
- #handle_response(response) ⇒ Object
-
#initialize(component_node, translator) ⇒ AMIAction
constructor
A new instance of AMIAction.
- #setup ⇒ Object
Methods inherited from Component
#call_ended, #execute_command, #logger_id, #send_complete_event, #send_event
Methods included from DeadActorSafety
Constructor Details
#initialize(component_node, translator) ⇒ AMIAction
Returns a new instance of AMIAction.
11 12 13 14 |
# File 'lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb', line 11 def initialize(component_node, translator) super component_node, nil @translator = translator end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
9 10 11 |
# File 'lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb', line 9 def action @action end |
#translator ⇒ Object (readonly)
Returns the value of attribute translator.
9 10 11 |
# File 'lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb', line 9 def translator @translator end |
Instance Method Details
#execute ⇒ Object
21 22 23 24 |
# File 'lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb', line 21 def execute send_action send_ref end |
#handle_response(response) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb', line 26 def handle_response(response) case response when RubyAMI::Error send_complete_event error_reason(response) when RubyAMI::Response send_events send_complete_event success_reason(response) end end |
#setup ⇒ Object
16 17 18 19 |
# File 'lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb', line 16 def setup @action = create_action @id = @action.action_id end |