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.



162
163
164
165
# File 'lib/i18n-inflector/errors.rb', line 162

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.



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

def original_kind
  @original_kind
end

Instance Method Details

#messageObject



167
168
169
170
171
# File 'lib/i18n-inflector/errors.rb', line 167

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