Exception: Token::Resolver::UnresolvedTokenError

Inherits:
Error
  • Object
show all
Defined in:
lib/token/resolver.rb

Overview

Raised when a token has no replacement value and on_missing is :raise.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token_key, message = nil) ⇒ UnresolvedTokenError

Returns a new instance of UnresolvedTokenError.

Parameters:

  • token_key (String)

    The unresolved token key

  • message (String, nil) (defaults to: nil)

    Optional custom message



40
41
42
43
# File 'lib/token/resolver.rb', line 40

def initialize(token_key, message = nil)
  @token_key = token_key
  super(message || "Unresolved token: #{token_key}")
end

Instance Attribute Details

#token_keyString (readonly)

Returns The token key that was not found.

Returns:

  • (String)

    The token key that was not found



36
37
38
# File 'lib/token/resolver.rb', line 36

def token_key
  @token_key
end