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.


209
210
211
212
# File 'lib/i18n-inflector/errors.rb', line 209

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

Instance Attribute Details

#pointerObject

Returns the value of attribute pointer


207
208
209
# File 'lib/i18n-inflector/errors.rb', line 207

def pointer
  @pointer
end

Instance Method Details

#messageObject


214
215
216
217
218
219
# File 'lib/i18n-inflector/errors.rb', line 214

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