Class: Services::Responses::Error

Inherits:
Base
  • Object
show all
Defined in:
lib/services/responses/error.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#result

Instance Method Summary collapse

Methods inherited from Base

async_environment?, #error?

Constructor Details

#initialize(result, error_message: nil, error_code: nil, raise_exception_on_async_error: nil) ⇒ Error

Returns a new instance of Error.



6
7
8
9
10
11
# File 'lib/services/responses/error.rb', line 6

def initialize(result, error_message: nil, error_code: nil, raise_exception_on_async_error: nil)
  @result, @error_message, @error_code, @raise_exception_on_async_error = 
  result, error_message, error_code, raise_exception_on_async_error

  raise_if_async!
end

Instance Attribute Details

#error_codeObject

Returns the value of attribute error_code.



4
5
6
# File 'lib/services/responses/error.rb', line 4

def error_code
  @error_code
end

#error_messageObject

Returns the value of attribute error_message.



4
5
6
# File 'lib/services/responses/error.rb', line 4

def error_message
  @error_message
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/services/responses/error.rb', line 13

def success?
  false
end