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.



145
146
147
148
149
150
# File 'lib/i18n-inflector/errors.rb', line 145

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
end

Instance Method Details

#messageObject



152
153
154
# File 'lib/i18n-inflector/errors.rb', line 152

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