Class: Zenlish::Inflect::NotEqualsLiteral
- Inherits:
-
UnaryInputExpression
- Object
- InputExpression
- UnaryInputExpression
- Zenlish::Inflect::NotEqualsLiteral
- Defined in:
- lib/zenlish/inflect/not_equals_literal.rb
Instance Attribute Summary collapse
-
#literal ⇒ Object
readonly
Returns the value of attribute literal.
Attributes inherited from UnaryInputExpression
Instance Method Summary collapse
-
#initialize(anArgument, aLiteral) ⇒ NotEqualsLiteral
constructor
A new instance of NotEqualsLiteral.
- #success?(headings, lexeme, actuals) ⇒ Boolean
Constructor Details
#initialize(anArgument, aLiteral) ⇒ NotEqualsLiteral
Returns a new instance of NotEqualsLiteral.
8 9 10 11 |
# File 'lib/zenlish/inflect/not_equals_literal.rb', line 8 def initialize(anArgument, aLiteral) super(anArgument) @literal = aLiteral end |
Instance Attribute Details
#literal ⇒ Object (readonly)
Returns the value of attribute literal.
6 7 8 |
# File 'lib/zenlish/inflect/not_equals_literal.rb', line 6 def literal @literal end |
Instance Method Details
#success?(headings, lexeme, actuals) ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/zenlish/inflect/not_equals_literal.rb', line 13 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] val != literal end end |