class Zenlish::Inflect::InflectionRule

An inflection rule has two-parts:

Attributes

conditions[R]
consequent[R]

Public Class Methods

new(theConditions, aConsequentExpr) click to toggle source
# File lib/zenlish/inflect/inflection_rule.rb, line 12
def initialize(theConditions, aConsequentExpr)
  @conditions = theConditions
  @consequent = aConsequentExpr
end

Public Instance Methods

apply(theHeadings, aLexeme, actuals) click to toggle source
# File lib/zenlish/inflect/inflection_rule.rb, line 21
def apply(theHeadings, aLexeme, actuals)
  consequent.generate(theHeadings, aLexeme, actuals)
end
force_apply(theHeadings, aLexeme) click to toggle source
# File lib/zenlish/inflect/inflection_rule.rb, line 25
def force_apply(theHeadings, aLexeme)
  consequent.generate(theHeadings, aLexeme)
end
success?(theHeadings, aLexeme, actuals) click to toggle source
# File lib/zenlish/inflect/inflection_rule.rb, line 17
def success?(theHeadings, aLexeme, actuals)
  conditions.all? { |cond| cond.success?(theHeadings, aLexeme, actuals) }
end