Class: I18n::BadInflectionToken
- Inherits:
-
InflectionConfigurationException
- Object
- ArgumentError
- InflectionException
- InflectionConfigurationException
- I18n::BadInflectionToken
- Defined in:
- lib/i18n-inflector/errors.rb
Overview
This is raised when an inflection token or its description has a bad name. This includes an empty name or a name containing prohibited characters.
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
Attributes inherited from InflectionConfigurationException
Attributes inherited from InflectionException
Instance Method Summary collapse
-
#initialize(locale, token, kind = nil, description = nil) ⇒ BadInflectionToken
constructor
A new instance of BadInflectionToken.
- #message ⇒ Object
Constructor Details
#initialize(locale, token, kind = nil, description = nil) ⇒ BadInflectionToken
Returns a new instance of BadInflectionToken.
229 230 231 232 |
# File 'lib/i18n-inflector/errors.rb', line 229 def initialize(locale, token, kind=nil, description=nil) super(locale, token, kind) @description = description end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
227 228 229 |
# File 'lib/i18n-inflector/errors.rb', line 227 def description @description end |
Instance Method Details
#message ⇒ Object
234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/i18n-inflector/errors.rb', line 234 def if @description.nil? "" << super << "inflection token #{@token.inspect} " \ "has a bad name" else "" << super << "inflection token #{@token.inspect} " \ "has a bad description #{@description.inspect}" end end |