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.
106 107 108 |
# File 'lib/i18n-inflector/errors.rb', line 106 def initialize(locale, pattern, token, kind=nil) super(locale, pattern, token, kind) end |
Instance Method Details
#message ⇒ Object
110 111 112 113 114 115 116 117 |
# File 'lib/i18n-inflector/errors.rb', line 110 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 |