Class: WAB::Impl::And
- Defined in:
- lib/wab/impl/exprs/and.rb
Overview
A logical AND expression.
Instance Method Summary collapse
- #eval(data) ⇒ Object
-
#initialize(*args) ⇒ And
constructor
Create an AND 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) ⇒ And
Create an AND expression with the provided arguments which must be instances of subclasses of the Expr class.
- args
-
argument to the AND expression
12 13 14 |
# File 'lib/wab/impl/exprs/and.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/and.rb', line 16 def eval(data) @args.each { |a| return false unless a.eval(data) } true end |
#native ⇒ Object
23 24 25 |
# File 'lib/wab/impl/exprs/and.rb', line 23 def native() @args.map(&:native).unshift('AND') end |