Class: ActiveRecord::Refined::AST::Or

Inherits:
Predicate show all
Defined in:
lib/active_record/refined/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Predicate

#!, #&, #|

Methods inherited from Node

#as, #asc, #collate, #desc

Constructor Details

#initialize(left, right) ⇒ Or

Returns a new instance of Or.



2385
2386
2387
2388
# File 'lib/active_record/refined/ast.rb', line 2385

def initialize(left, right)
  @left = left
  @right = right
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



2383
2384
2385
# File 'lib/active_record/refined/ast.rb', line 2383

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



2383
2384
2385
# File 'lib/active_record/refined/ast.rb', line 2383

def right
  @right
end

Instance Method Details

#to_arel(table, model) ⇒ Object



2390
2391
2392
# File 'lib/active_record/refined/ast.rb', line 2390

def to_arel(table, model)
  left.to_arel(table, model).or(right.to_arel(table, model))
end