Exception: ApiAuthenticator::InvalidTokenError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/api_authenticator/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time, keys_and_tokens) ⇒ InvalidTokenError

Returns a new instance of InvalidTokenError.



22
23
24
25
# File 'lib/api_authenticator/errors.rb', line 22

def initialize(time, keys_and_tokens)
  @time = time
  @keys_and_tokens = keys_and_tokens
end

Instance Attribute Details

#keys_and_tokensObject (readonly)

Returns the value of attribute keys_and_tokens.



20
21
22
# File 'lib/api_authenticator/errors.rb', line 20

def keys_and_tokens
  @keys_and_tokens
end

#timeObject (readonly)

Returns the value of attribute time.



20
21
22
# File 'lib/api_authenticator/errors.rb', line 20

def time
  @time
end

Instance Method Details

#constructed_messageObject



28
29
30
31
32
33
34
# File 'lib/api_authenticator/errors.rb', line 28

def constructed_message
  message = ""
  @keys_and_tokens.each do |key_and_token|
    message << "Invalid Token Error Time: #{@time} Shared Key: #{key_and_token[0]} expected token: #{key_and_token[2]} actual token: #{key_and_token[1]}"
  end
  message
end