Class: SmsBroker::Client::Response::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/sms_broker/client/response/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/sms_broker/client/response/error.rb', line 5

def response
  @response
end

#serializedObject (readonly)

Returns the value of attribute serialized.



5
6
7
# File 'lib/sms_broker/client/response/error.rb', line 5

def serialized
  @serialized
end

#serviceObject (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

Returns:

  • (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

Returns:

  • (Boolean)


15
16
17
# File 'lib/sms_broker/client/response/error.rb', line 15

def success?
  false
end