Class: I18n::MisplacedInflectionToken

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

Overview

This is raised when an inflection token used in a pattern does not match an assumed kind determined by reading previous tokens from that pattern or by the given strict kind of a named pattern.

Instance Attribute Summary

Attributes inherited from InflectionPatternException

#pattern

Attributes inherited from InflectionException

#key, #kind, #token

Instance Method Summary collapse

Constructor Details

#initialize(locale, pattern, token, kind) ⇒ MisplacedInflectionToken

Returns a new instance of MisplacedInflectionToken.



154
155
156
# File 'lib/i18n-inflector/errors.rb', line 154

def initialize(locale, pattern, token, kind)
  super(locale, pattern, token, kind)
end

Instance Method Details

#messageObject



158
159
160
161
162
# File 'lib/i18n-inflector/errors.rb', line 158

def message
  "" << super <<
  "token #{@token.to_s.inspect} " \
  "is not of the expected kind #{@kind.inspect}"
end