Class: Sequel::SQL::AliasedExpression
- Inherits:
-
Expression
- Object
- Expression
- Sequel::SQL::AliasedExpression
- Defined in:
- lib/sequel/sql.rb
Overview
Represents an aliasing of an expression to a given alias.
Instance Attribute Summary collapse
-
#alias ⇒ Object
readonly
The alias to use for the expression.
-
#columns ⇒ Object
readonly
The columns aliases (derived column list) to use, for when the aliased expression is a record or set of records (such as a dataset).
-
#expression ⇒ Object
readonly
The expression to alias.
Instance Method Summary collapse
-
#initialize(expression, aliaz, columns = nil) ⇒ AliasedExpression
constructor
Create an object with the given expression, alias, and optional column aliases.
Methods inherited from Expression
#==, attr_reader, #clone, #eql?, #hash, inherited, #inspect
Constructor Details
#initialize(expression, aliaz, columns = nil) ⇒ AliasedExpression
Create an object with the given expression, alias, and optional column aliases.
1011 1012 1013 1014 1015 1016 |
# File 'lib/sequel/sql.rb', line 1011 def initialize(expression, aliaz, columns=nil) @expression = expression @alias = aliaz @columns = columns freeze end |
Instance Attribute Details
#alias ⇒ Object (readonly)
The alias to use for the expression.
1004 1005 1006 |
# File 'lib/sequel/sql.rb', line 1004 def alias @alias end |
#columns ⇒ Object (readonly)
The columns aliases (derived column list) to use, for when the aliased expression is a record or set of records (such as a dataset).
1008 1009 1010 |
# File 'lib/sequel/sql.rb', line 1008 def columns @columns end |
#expression ⇒ Object (readonly)
The expression to alias
1001 1002 1003 |
# File 'lib/sequel/sql.rb', line 1001 def expression @expression end |