Class: InclusiveOrExpression
- Inherits:
-
OrExpression
- Object
- Expression
- CompoundExpression
- OrExpression
- InclusiveOrExpression
- Defined in:
- lib/glark/match/ior.rb
Overview
Evaluates the expressions, and is satisfied when any one returns true.
Instance Attribute Summary
Attributes inherited from CompoundExpression
Attributes inherited from Expression
Instance Method Summary collapse
Methods inherited from OrExpression
#end_position, #evaluate, #explain, #inspect
Methods inherited from CompoundExpression
#==, #initialize, #reset_file, #start_position
Methods inherited from Expression
#add_match, #end_position, #initialize, #process, #reset_file, #start_position, #to_s
Constructor Details
This class inherits a constructor from CompoundExpression
Instance Method Details
#criteria ⇒ Object
17 18 19 |
# File 'lib/glark/match/ior.rb', line 17 def criteria ops.size == 2 ? "either" : "any of" end |
#is_match?(matched_ops) ⇒ Boolean
9 10 11 |
# File 'lib/glark/match/ior.rb', line 9 def is_match? matched_ops return matched_ops.size > 0 end |
#operator ⇒ Object
13 14 15 |
# File 'lib/glark/match/ior.rb', line 13 def operator "or" end |