Class: SmsBroker::Client::Response::Error
- Inherits:
-
Object
- Object
- SmsBroker::Client::Response::Error
- Defined in:
- lib/sms_broker/client/response/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#serialized ⇒ Object
readonly
Returns the value of attribute serialized.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(service, response, serialized = {}) ⇒ Error
constructor
A new instance of Error.
- #invalid_sender_id? ⇒ Boolean
- #success? ⇒ Boolean
Constructor Details
#initialize(service, response, serialized = {}) ⇒ Error
Returns a new instance of Error.
9 10 11 12 13 |
# File 'lib/sms_broker/client/response/error.rb', line 9 def initialize(service, response, serialized = {}) @service = service @response = response @serialized = { errors: serialized } end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/sms_broker/client/response/error.rb', line 5 def response @response end |
#serialized ⇒ Object (readonly)
Returns the value of attribute serialized.
5 6 7 |
# File 'lib/sms_broker/client/response/error.rb', line 5 def serialized @serialized end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
5 6 7 |
# File 'lib/sms_broker/client/response/error.rb', line 5 def service @service end |
Instance Method Details
#invalid_sender_id? ⇒ Boolean
19 20 21 |
# File 'lib/sms_broker/client/response/error.rb', line 19 def invalid_sender_id? (@serialized[:errors]['sender_id'] || []).include?('is invalid') end |
#success? ⇒ Boolean
15 16 17 |
# File 'lib/sms_broker/client/response/error.rb', line 15 def success? false end |