Class: I18n::InflectionPatternException Abstract

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

Overview

This class is abstract.

It is a parent class for all exceptions related to inflection patterns that are processed.

Instance Attribute Summary collapse

Attributes inherited from InflectionException

#key, #kind, #token

Instance Method Summary collapse

Constructor Details

#initialize(locale, pattern, token, kind) ⇒ InflectionPatternException

Returns a new instance of InflectionPatternException.



30
31
32
33
# File 'lib/i18n-inflector/errors.rb', line 30

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

Instance Attribute Details

#patternObject

Returns the value of attribute pattern.



28
29
30
# File 'lib/i18n-inflector/errors.rb', line 28

def pattern
  @pattern
end

Instance Method Details

#messageObject



35
36
37
38
# File 'lib/i18n-inflector/errors.rb', line 35

def message
  mkey = @key.nil? ? '' : ".#{@key}"
  @pattern.nil? ? '' : "#{@locale}#{mkey}: #{@pattern} - "
end