Class: ActiveRecord::Refined::AST::Node
- Inherits:
-
Object
- Object
- ActiveRecord::Refined::AST::Node
- 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.
Direct Known Subclasses
Aggregate, Arithmetic, As, Bitwise, BitwiseNot, Case, Case::When, Cast, Collate, Column, DatetimeValueFunction, Extract, Function, GroupingSets, JsonAggregate, JsonBuild, JsonExcept, JsonKeys, JsonLiteral, JsonPath, JsonSet, Operation, Ordering, Over, Predicate, Quantified, Sql, StringAggregate, Value
Instance Method Summary collapse
-
#as(alias_name, quote: true) ⇒ AST::As
The expression under an alias, as BlockSyntax#as gives a column one.
-
#asc ⇒ AST::Ordering
An ascending ordering by the expression.
-
#collate(name) ⇒ AST::Collate
The expression under a collation, as BlockSyntax#collate.
-
#desc ⇒ AST::Ordering
A descending ordering by the expression.
Instance Method Details
#as(alias_name, quote: true) ⇒ AST::As
The expression under an alias, as BlockSyntax#as gives a column one.
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 |
#asc ⇒ AST::Ordering
An ascending ordering by the expression.
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.
677 678 679 |
# File 'lib/active_record/refined/ast.rb', line 677 def collate(name) Collate.new(self, name) end |
#desc ⇒ AST::Ordering
A descending ordering by the expression.
671 672 673 |
# File 'lib/active_record/refined/ast.rb', line 671 def desc Ordering.new(self, :desc) end |