Sha256: 7b80c285025f5bc198cb6eea512ca606acfcb05d79f89ab22fb7dd9ae5975ead

Contents?: true

Size: 232 Bytes

Versions: 2

Compression:

Stored size: 232 Bytes

Contents

class Or < Arity2Operators
  Operator.register('||', Or, 14)

  def to_sql
    "(#{@left.to_sql} OR #{@right.to_sql})"
  end

  def evaluate(attributes={})
    !!@left.evaluate(attributes) || !!@right.evaluate(attributes)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lamep-0.2.1 lib/lamep/Expressions/or.rb
lamep-0.2 lib/lamep/Expressions/or.rb