Class: VoiceCom::Response
- Inherits:
-
Object
- Object
- VoiceCom::Response
- Defined in:
- lib/voice_com/response.rb
Instance Attribute Summary collapse
-
#answer ⇒ Object
Returns the value of attribute answer.
-
#answer_hash ⇒ Object
readonly
Returns the value of attribute answer_hash.
-
#dlr ⇒ Object
Returns the value of attribute dlr.
-
#from ⇒ Object
Returns the value of attribute from.
-
#sid ⇒ Object
Returns the value of attribute sid.
-
#smsID ⇒ Object
Returns the value of attribute smsID.
-
#to ⇒ Object
Returns the value of attribute to.
-
#ts ⇒ Object
Returns the value of attribute ts.
-
#voicecom_id ⇒ Object
Returns the value of attribute voicecom_id.
Instance Method Summary collapse
- #get_answer ⇒ Object
-
#initialize(args = {}) {|_self| ... } ⇒ Response
constructor
A new instance of Response.
- #parse_answer ⇒ Object
- #sms_id ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(args = {}) {|_self| ... } ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 12 |
# File 'lib/voice_com/response.rb', line 7 def initialize(args = {}) args.each {|k,v| instance_variable_set("@#{k.strip}", v)} yield self if block_given? validate! parse_answer end |
Instance Attribute Details
#answer ⇒ Object
Returns the value of attribute answer.
4 5 6 |
# File 'lib/voice_com/response.rb', line 4 def answer @answer end |
#answer_hash ⇒ Object (readonly)
Returns the value of attribute answer_hash.
5 6 7 |
# File 'lib/voice_com/response.rb', line 5 def answer_hash @answer_hash end |
#dlr ⇒ Object
Returns the value of attribute dlr.
4 5 6 |
# File 'lib/voice_com/response.rb', line 4 def dlr @dlr end |
#from ⇒ Object
Returns the value of attribute from.
4 5 6 |
# File 'lib/voice_com/response.rb', line 4 def from @from end |
#sid ⇒ Object
Returns the value of attribute sid.
4 5 6 |
# File 'lib/voice_com/response.rb', line 4 def sid @sid end |
#smsID ⇒ Object
Returns the value of attribute smsID.
4 5 6 |
# File 'lib/voice_com/response.rb', line 4 def smsID @smsID end |
#to ⇒ Object
Returns the value of attribute to.
4 5 6 |
# File 'lib/voice_com/response.rb', line 4 def to @to end |
#ts ⇒ Object
Returns the value of attribute ts.
4 5 6 |
# File 'lib/voice_com/response.rb', line 4 def ts @ts end |
#voicecom_id ⇒ Object
Returns the value of attribute voicecom_id.
4 5 6 |
# File 'lib/voice_com/response.rb', line 4 def voicecom_id @voicecom_id end |
Instance Method Details
#get_answer ⇒ Object
22 23 24 |
# File 'lib/voice_com/response.rb', line 22 def get_answer Hash[@answer.split("+").map{|x| x.split(":")}] end |
#parse_answer ⇒ Object
18 19 20 |
# File 'lib/voice_com/response.rb', line 18 def parse_answer @answer_hash = get_answer end |
#sms_id ⇒ Object
14 15 16 |
# File 'lib/voice_com/response.rb', line 14 def sms_id @dlr end |
#success? ⇒ Boolean
27 28 29 30 31 32 |
# File 'lib/voice_com/response.rb', line 27 def success? #in que to be implemented true end |