Class: WAB::Impl::Or
Overview
A logical OR expression.
Instance Method Summary collapse
- #eval(data) ⇒ Object
-
#initialize(*args) ⇒ Or
constructor
Create an OR expression with the provided arguments which must be instances of subclasses of the Expr class.
- #native ⇒ Object
Methods inherited from BoolExpr
Constructor Details
#initialize(*args) ⇒ Or
Create an OR expression with the provided arguments which must be instances of subclasses of the Expr class.
- args
-
argument to the OR expression
12 13 14 |
# File 'lib/wab/impl/exprs/or.rb', line 12 def initialize(*args) super end |
Instance Method Details
#eval(data) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/wab/impl/exprs/or.rb', line 16 def eval(data) @args.each { |a| return true if a.eval(data) } false end |
#native ⇒ Object
23 24 25 |
# File 'lib/wab/impl/exprs/or.rb', line 23 def native() @args.map(&:native).unshift('OR') end |