Class: RDStation::ErrorHandler::ExpiredAccessToken

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

Constant Summary collapse

EXPIRED_TOKEN_ERROR =
'error="expired_token"'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ ExpiredAccessToken

Returns a new instance of ExpiredAccessToken.



8
9
10
# File 'lib/rdstation/error_handler/expired_access_token.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/expired_access_token.rb', line 4

def errors
  @errors
end

Instance Method Details

#raise_errorObject



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

def raise_error
  return if expired_token_errors.empty?
  raise RDStation::Error::ExpiredAccessToken, expired_token_errors.first
end