Class: ActiveRecord::Refined::AST::Ordering

Inherits:
Node
  • Object
show all
Defined in:
lib/active_record/refined/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#as, #asc, #desc

Constructor Details

#initialize(operand, direction) ⇒ Ordering

Returns a new instance of Ordering.



182
183
184
185
# File 'lib/active_record/refined/ast.rb', line 182

def initialize(operand, direction)
  @operand = operand
  @direction = direction
end

Instance Attribute Details

#directionObject (readonly)

Returns the value of attribute direction.



180
181
182
# File 'lib/active_record/refined/ast.rb', line 180

def direction
  @direction
end

#operandObject (readonly)

Returns the value of attribute operand.



180
181
182
# File 'lib/active_record/refined/ast.rb', line 180

def operand
  @operand
end

Instance Method Details

#to_arel(table) ⇒ Object



187
188
189
# File 'lib/active_record/refined/ast.rb', line 187

def to_arel(table)
  to_arel_operand(operand, table).public_send(direction)
end