Class: Sequel::SQL::AliasedExpression
- Inherits:
-
SpecificExpression
- Object
- Expression
- SpecificExpression
- Sequel::SQL::AliasedExpression
- Defined in:
- lib/sequel_core/sql.rb
Overview
Represents an aliasing of an expression/column to a given name.
Instance Attribute Summary collapse
-
#aliaz ⇒ Object
readonly
The alias to use for the expression, not alias since that is a keyword in ruby.
-
#expression ⇒ Object
readonly
The expression to alias.
Instance Method Summary collapse
-
#initialize(expression, aliaz) ⇒ AliasedExpression
constructor
Create an object with the given expression and alias.
-
#to_s(ds) ⇒ Object
Delegate the creation of the resulting SQL to the given dataset, since it may be database dependent.
Methods inherited from Expression
Constructor Details
#initialize(expression, aliaz) ⇒ AliasedExpression
Create an object with the given expression and alias.
392 393 394 |
# File 'lib/sequel_core/sql.rb', line 392 def initialize(expression, aliaz) @expression, @aliaz = expression, aliaz end |
Instance Attribute Details
#aliaz ⇒ Object (readonly)
The alias to use for the expression, not alias since that is a keyword in ruby.
389 390 391 |
# File 'lib/sequel_core/sql.rb', line 389 def aliaz @aliaz end |
#expression ⇒ Object (readonly)
The expression to alias
385 386 387 |
# File 'lib/sequel_core/sql.rb', line 385 def expression @expression end |
Instance Method Details
#to_s(ds) ⇒ Object
Delegate the creation of the resulting SQL to the given dataset, since it may be database dependent.
398 399 400 |
# File 'lib/sequel_core/sql.rb', line 398 def to_s(ds) ds.aliased_expression_sql(self) end |