Class: I18n::DuplicatedInflectionToken

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

Overview

This is raised when an inflection token of the same name is already defined in inflections tree of translation data.

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, original_kind) ⇒ DuplicatedInflectionToken

Returns a new instance of DuplicatedInflectionToken.



189
190
191
192
# File 'lib/i18n-inflector/errors.rb', line 189

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

Instance Attribute Details

#original_kindObject

Returns the value of attribute original_kind.



187
188
189
# File 'lib/i18n-inflector/errors.rb', line 187

def original_kind
  @original_kind
end

Instance Method Details

#messageObject



194
195
196
197
198
# File 'lib/i18n-inflector/errors.rb', line 194

def message
  "" << super <<
  "token #{@token.inspect} " \
  "was already assigned to the kind #{@original_kind.inspect}"
end