Class: Qdsl::Boolean
- Inherits:
-
Expression
- Object
- Expression
- Qdsl::Boolean
- Defined in:
- lib/boolean.rb
Instance Method Summary collapse
-
#initialize(operator, exprs) ⇒ Boolean
constructor
A new instance of Boolean.
- #render(context, ids) ⇒ Object
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 |