Class: ActiveRecord::Refined::AST::Node

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

Overview

An expression a block has built, whatever it was built from. The methods here are what every one takes; most subclasses add the conditions of Predications and the operators of Arithmetics.

Instance Method Summary collapse

Instance Method Details

#as(alias_name, quote: true) ⇒ AST::As

The expression under an alias, as BlockSyntax#as gives a column one.

Returns:



659
660
661
# File 'lib/active_record/refined/ast.rb', line 659

def as(alias_name, quote: true)
  As.new(self, alias_name, quote: quote)
end

#ascAST::Ordering

An ascending ordering by the expression.

Returns:



665
666
667
# File 'lib/active_record/refined/ast.rb', line 665

def asc
  Ordering.new(self, :asc)
end

#collate(name) ⇒ AST::Collate

The expression under a collation, as BlockSyntax#collate.

Returns:



677
678
679
# File 'lib/active_record/refined/ast.rb', line 677

def collate(name)
  Collate.new(self, name)
end

#descAST::Ordering

A descending ordering by the expression.

Returns:



671
672
673
# File 'lib/active_record/refined/ast.rb', line 671

def desc
  Ordering.new(self, :desc)
end