Class: RubyAsterisk::Response
- Inherits:
-
Object
- Object
- RubyAsterisk::Response
- Defined in:
- lib/ruby-asterisk/response.rb
Overview
Class for response coming from Asterisk
Instance Attribute Summary collapse
-
#action_id ⇒ Object
Returns the value of attribute action_id.
-
#data ⇒ Object
Returns the value of attribute data.
-
#message ⇒ Object
Returns the value of attribute message.
-
#raw_response ⇒ Object
Returns the value of attribute raw_response.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, response) ⇒ Response
constructor
A new instance of Response.
- #success ⇒ Object
Constructor Details
#initialize(type, response) ⇒ Response
Returns a new instance of Response.
11 12 13 14 15 16 17 |
# File 'lib/ruby-asterisk/response.rb', line 11 def initialize(type,response) self.raw_response = response self.type = type self.action_id = self._parse_action_id self. = self. self.data = self._parse_response end |
Instance Attribute Details
#action_id ⇒ Object
Returns the value of attribute action_id.
9 10 11 |
# File 'lib/ruby-asterisk/response.rb', line 9 def action_id @action_id end |
#data ⇒ Object
Returns the value of attribute data.
9 10 11 |
# File 'lib/ruby-asterisk/response.rb', line 9 def data @data end |
#message ⇒ Object
Returns the value of attribute message.
9 10 11 |
# File 'lib/ruby-asterisk/response.rb', line 9 def @message end |
#raw_response ⇒ Object
Returns the value of attribute raw_response.
9 10 11 |
# File 'lib/ruby-asterisk/response.rb', line 9 def raw_response @raw_response end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'lib/ruby-asterisk/response.rb', line 9 def type @type end |
Instance Method Details
#success ⇒ Object
19 20 21 |
# File 'lib/ruby-asterisk/response.rb', line 19 def success self.raw_response.include?("Response: Success") end |