Class: Qdsl::Boolean

Inherits:
Expression show all
Defined in:
lib/boolean.rb

Direct Known Subclasses

And, Or

Instance Method Summary collapse

Constructor Details

#initialize(operator, exprs) ⇒ Boolean

Returns a new instance of Boolean.



3
4
5
6
# File 'lib/boolean.rb', line 3

def initialize(operator, exprs)
  @operator = operator
  @exprs = exprs
end

Instance Method Details

#render(context, ids) ⇒ Object



8
9
10
11
# File 'lib/boolean.rb', line 8

def render(context, ids)
  expr_results = @exprs.collect { |x| render_operand(context, ids, x) }
  expr_results.collect { |x| "(#{x})" }.join(" #{@operator} ")
end