class Zenlish::Inflect::EqualsLiteral

Attributes

literal[R]

Public Class Methods

new(anArgument, aLiteral) click to toggle source
Calls superclass method
# File lib/zenlish/inflect/equals_literal.rb, line 10
def initialize(anArgument, aLiteral)
  super(anArgument)
  @literal = aLiteral
end

Public Instance Methods

success?(headings, lexeme, actuals) click to toggle source
# File lib/zenlish/inflect/equals_literal.rb, line 15
def success?(headings, lexeme, actuals)
  if actuals.empty?
    hd = headings[argument.index]
    feat_def = hd.evaluate_for(lexeme)
    feat_def.domain.include?(literal)
  else
    val = actuals[argument.index]
    if val.kind_of?(Feature::FeatureDef)
      val.domain.include?(literal)
    else
      val == literal
    end
  end
end