Exception: ATM::TestCaseError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/atm_ruby/error_handeling/test_case_error.rb

Instance Attribute Summary collapse

Attributes inherited from BaseError

#response

Instance Method Summary collapse

Methods inherited from BaseError

#raise_400, #raise_401, #raise_404, #raise_500

Constructor Details

#initialize(response) ⇒ TestCaseError

Returns a new instance of TestCaseError.



6
7
8
9
10
11
12
13
14
# File 'lib/atm_ruby/error_handeling/test_case_error.rb', line 6

def initialize(response)
  @response = response
  @message = case @response.code
             when 400 then raise_400
             when 401 then raise_401
             when 404 then raise_404('No Test Case has been found with the given key.')
             when 500 then raise_500
             end
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/atm_ruby/error_handeling/test_case_error.rb', line 4

def message
  @message
end