Exception: Kotoshu::AffixRuleError

Inherits:
Error
  • Object
show all
Defined in:
lib/kotoshu/core/exceptions.rb

Overview

Error raised when an affix rule cannot be parsed.

Examples:

Invalid affix rule

raise AffixRuleError, "Invalid affix rule: PFX A Y 1 re"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, rule: nil) ⇒ AffixRuleError

Create a new affix rule error.

Parameters:

  • message (String)

    The error message

  • rule (String) (defaults to: nil)

    The rule that failed to parse (optional)



95
96
97
98
# File 'lib/kotoshu/core/exceptions.rb', line 95

def initialize(message, rule: nil)
  @rule = rule
  super(message)
end

Instance Attribute Details

#ruleString? (readonly)

Returns The rule that failed to parse.

Returns:

  • (String, nil)

    The rule that failed to parse



101
102
103
# File 'lib/kotoshu/core/exceptions.rb', line 101

def rule
  @rule
end