Class: RDStation::ErrorHandler::Unauthorized

Inherits:
Object
  • Object
show all
Defined in:
lib/rdstation/error_handler/unauthorized.rb

Constant Summary collapse

ERROR_CODE =
'UNAUTHORIZED'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ Unauthorized

Returns a new instance of Unauthorized.



8
9
10
# File 'lib/rdstation/error_handler/unauthorized.rb', line 8

def initialize(errors)
  @errors = errors
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



4
5
6
# File 'lib/rdstation/error_handler/unauthorized.rb', line 4

def errors
  @errors
end

Instance Method Details

#raise_errorObject



12
13
14
15
# File 'lib/rdstation/error_handler/unauthorized.rb', line 12

def raise_error
  return if unauthorized_errors.empty?
  raise RDStation::Error::Unauthorized, unauthorized_errors.first
end