Class: I18n::BadInflectionAlias

Inherits:
InflectionConfigurationException show all
Defined in:
lib/i18n-inflector/errors.rb

Overview

This is raised when an alias for an inflection token points to a token that doesn’t exists. It is also raised when default token of some kind points to a non-existent token.

Instance Attribute Summary collapse

Attributes inherited from InflectionConfigurationException

#locale

Attributes inherited from InflectionException

#key, #kind, #token

Instance Method Summary collapse

Constructor Details

#initialize(locale, token, kind, pointer) ⇒ BadInflectionAlias

Returns a new instance of BadInflectionAlias.



180
181
182
183
# File 'lib/i18n-inflector/errors.rb', line 180

def initialize(locale, token, kind, pointer)
  super(locale, token, kind)
  @pointer = pointer
end

Instance Attribute Details

#pointerObject

Returns the value of attribute pointer.



178
179
180
# File 'lib/i18n-inflector/errors.rb', line 178

def pointer
  @pointer
end

Instance Method Details

#messageObject



185
186
187
188
189
190
# File 'lib/i18n-inflector/errors.rb', line 185

def message
  what = (token == :default) ? 'default token' : "alias #{@token.inspect}"
  '' << super <<
    "the #{what} " \
    "points to an unknown token #{@pointer.inspect}"
end