Class: I18n::ComplexPatternMalformed

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

Overview

This is raised when a complex inflection pattern is malformed and cannot be reduced to set of regular patterns.

Instance Attribute Summary

Attributes inherited from InflectionPatternException

#pattern

Attributes inherited from InflectionException

#key, #kind, #token

Instance Method Summary collapse

Constructor Details

#initialize(locale, pattern, token, complex_kind) ⇒ ComplexPatternMalformed

Returns a new instance of ComplexPatternMalformed.


170
171
172
173
174
175
# File 'lib/i18n-inflector/errors.rb', line 170

def initialize(locale, pattern, token, complex_kind)
  unless pattern.include?(I18n::Inflector::Config::Markers::PATTERN)
    pattern = I18n::Inflector::Config::Markers::PATTERN + "#{complex_kind}{#{pattern}}"
  end
  super(locale, pattern, token, complex_kind)
end

Instance Method Details

#messageObject


177
178
179
# File 'lib/i18n-inflector/errors.rb', line 177

def message
  "" << super << "pattern is malformed; token count differs from kind count"
end