Class: MitakeSms::Response
- Inherits:
-
Object
- Object
- MitakeSms::Response
- Defined in:
- lib/mitake_sms/response.rb
Instance Attribute Summary collapse
-
#account_point ⇒ Object
readonly
Returns the value of attribute account_point.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(raw_response) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(raw_response) ⇒ Response
Returns a new instance of Response.
7 8 9 10 |
# File 'lib/mitake_sms/response.rb', line 7 def initialize(raw_response) @raw_response = raw_response parse_response(raw_response) end |
Instance Attribute Details
#account_point ⇒ Object (readonly)
Returns the value of attribute account_point.
5 6 7 |
# File 'lib/mitake_sms/response.rb', line 5 def account_point @account_point end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/mitake_sms/response.rb', line 5 def code @code end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/mitake_sms/response.rb', line 5 def error @error end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id.
5 6 7 |
# File 'lib/mitake_sms/response.rb', line 5 def @message_id end |
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
5 6 7 |
# File 'lib/mitake_sms/response.rb', line 5 def raw_response @raw_response end |
Instance Method Details
#error? ⇒ Boolean
16 17 18 |
# File 'lib/mitake_sms/response.rb', line 16 def error? !success? end |
#success? ⇒ Boolean
12 13 14 |
# File 'lib/mitake_sms/response.rb', line 12 def success? @code == '1' end |