class WAB::Impl::Or

A logical OR expression.

Public Instance Methods

eval(data) click to toggle source

Create an OR expression with the provided arguments which must be instances of subclasses of the Expr class.

args

argument to the OR expression

def initialize(*args)

super

end

# File lib/wab/impl/exprs/or.rb, line 17
def eval(data)
  args.each { |a|
    return true if a.eval(data)
  }
  false
end
native() click to toggle source
# File lib/wab/impl/exprs/or.rb, line 24
def native()
  args.map(&:native).unshift('OR')
end