Class: Adhearsion::VoIP::Asterisk::Manager::ManagerInterfaceResponse
- Defined in:
- lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb
Overview
This is the object containing a response from Asterisk.
Note: not all responses have an ActionID!
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#action_id ⇒ Object
Returns the value of attribute action_id.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#text_body ⇒ Object
Returns the value of attribute text_body.
Class Method Summary collapse
Instance Method Summary collapse
- #[](arg) ⇒ Object
- #[]=(key, value) ⇒ Object
- #has_text_body? ⇒ Boolean
- #headers ⇒ Object
-
#initialize ⇒ ManagerInterfaceResponse
constructor
A new instance of ManagerInterfaceResponse.
Constructor Details
#initialize ⇒ ManagerInterfaceResponse
Returns a new instance of ManagerInterfaceResponse.
27 28 29 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 27 def initialize @headers = HashWithIndifferentAccess.new end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
22 23 24 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 22 def action @action end |
#action_id ⇒ Object
Returns the value of attribute action_id.
22 23 24 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 22 def action_id @action_id end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
25 26 27 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 25 def events @events end |
#text_body ⇒ Object
Returns the value of attribute text_body.
22 23 24 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 22 def text_body @text_body end |
Class Method Details
.from_immediate_response(text) ⇒ Object
15 16 17 18 19 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 15 def from_immediate_response(text) returning new do |instance| instance.text_body = text end end |
Instance Method Details
#[](arg) ⇒ Object
39 40 41 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 39 def [](arg) @headers[arg] end |
#[]=(key, value) ⇒ Object
43 44 45 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 43 def []=(key,value) @headers[key] = value end |
#has_text_body? ⇒ Boolean
31 32 33 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 31 def has_text_body? !! @text_body end |
#headers ⇒ Object
35 36 37 |
# File 'lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb', line 35 def headers @headers.clone end |