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.



33
34
35
36
# File 'lib/i18n-inflector/errors.rb', line 33

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

Instance Attribute Details

#patternObject

Returns the value of attribute pattern.



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

def pattern
  @pattern
end

Instance Method Details

#messageObject



38
39
40
41
# File 'lib/i18n-inflector/errors.rb', line 38

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