Class: ActiveRecord::Refined::AST::And

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, #desc

Constructor Details

#initialize(left, right) ⇒ And

Returns a new instance of And.



1628
1629
1630
1631
# File 'lib/active_record/refined/ast.rb', line 1628

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

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



1626
1627
1628
# File 'lib/active_record/refined/ast.rb', line 1626

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



1626
1627
1628
# File 'lib/active_record/refined/ast.rb', line 1626

def right
  @right
end

Instance Method Details

#to_arel(table, model) ⇒ Object



1633
1634
1635
# File 'lib/active_record/refined/ast.rb', line 1633

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