Class: AnySMS::Response
- Inherits:
-
Object
- Object
- AnySMS::Response
- Defined in:
- lib/any_sms/response.rb
Overview
Response object. Generated on each AnySMS.send_sms by backend implementations.
Instance Attribute Summary collapse
-
#meta ⇒ Object
see initialize.
-
#status ⇒ Object
readonly
see initialize.
Instance Method Summary collapse
-
#failed? ⇒ Boolean
Whether request has failed or not.
-
#initialize(status:, meta: nil) ⇒ Response
constructor
A new instance of Response.
-
#success? ⇒ Boolean
Whether request was succesful or not.
Constructor Details
#initialize(status:, meta: nil) ⇒ Response
Returns a new instance of Response.
14 15 16 17 |
# File 'lib/any_sms/response.rb', line 14 def initialize(status:, meta: nil) @status = status = end |
Instance Attribute Details
#meta ⇒ Object
see initialize
8 9 10 |
# File 'lib/any_sms/response.rb', line 8 def end |
#status ⇒ Object (readonly)
see initialize
5 6 7 |
# File 'lib/any_sms/response.rb', line 5 def status @status end |
Instance Method Details
#failed? ⇒ Boolean
Returns whether request has failed or not.
25 26 27 |
# File 'lib/any_sms/response.rb', line 25 def failed? !success? end |
#success? ⇒ Boolean
Returns whether request was succesful or not.
20 21 22 |
# File 'lib/any_sms/response.rb', line 20 def success? @status == :success end |