Class: I18n::InvalidInflectionToken
- Inherits:
-
InflectionPatternException
- Object
- ArgumentError
- InflectionException
- InflectionPatternException
- I18n::InvalidInflectionToken
- Defined in:
- lib/i18n-inflector/errors.rb
Overview
This is raised when a token given in a pattern is invalid (empty or has no kind assigned).
Instance Attribute Summary
Attributes inherited from InflectionPatternException
Attributes inherited from InflectionException
Instance Method Summary collapse
-
#initialize(locale, pattern, token, kind = nil) ⇒ InvalidInflectionToken
constructor
A new instance of InvalidInflectionToken.
- #message ⇒ Object
Constructor Details
#initialize(locale, pattern, token, kind = nil) ⇒ InvalidInflectionToken
Returns a new instance of InvalidInflectionToken.
93 94 95 |
# File 'lib/i18n-inflector/errors.rb', line 93 def initialize(locale, pattern, token, kind = nil) super end |
Instance Method Details
#message ⇒ Object
97 98 99 100 101 102 103 104 |
# File 'lib/i18n-inflector/errors.rb', line 97 def badkind = '' if !@token.to_s.empty? && !kind.nil? kind = @kind.to_s.empty? ? '' : @kind.to_sym badkind = " (processed kind: #{kind.inspect})" end '' << super << ("token #{@token.to_s.inspect} is invalid" + badkind) end |