Class: SmsAero2::Result
- Inherits:
-
Object
- Object
- SmsAero2::Result
- Defined in:
- lib/sms_aero2/result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(response) ⇒ Result
constructor
A new instance of Result.
- #reason ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Result
Returns a new instance of Result.
5 6 7 |
# File 'lib/sms_aero2/result.rb', line 5 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/sms_aero2/result.rb', line 3 def response @response end |
Instance Method Details
#data ⇒ Object
17 18 19 |
# File 'lib/sms_aero2/result.rb', line 17 def data response.fetch('data') end |
#reason ⇒ Object
13 14 15 |
# File 'lib/sms_aero2/result.rb', line 13 def reason response.fetch('message') end |
#success? ⇒ Boolean
9 10 11 |
# File 'lib/sms_aero2/result.rb', line 9 def success? response.fetch('success') end |