Class: Sequel::SQL::AliasedExpression

Inherits:
Expression show all
Defined in:
lib/sequel/sql.rb

Overview

Represents an aliasing of an expression to a given alias.

Instance Attribute Summary collapse

Instance Method Summary collapse

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.



984
985
986
987
988
989
# File 'lib/sequel/sql.rb', line 984

def initialize(expression, aliaz, columns=nil)
  @expression = expression
  @alias = aliaz
  @columns = columns
  freeze
end

Instance Attribute Details

#aliasObject (readonly)

The alias to use for the expression.



977
978
979
# File 'lib/sequel/sql.rb', line 977

def alias
  @alias
end

#columnsObject (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).



981
982
983
# File 'lib/sequel/sql.rb', line 981

def columns
  @columns
end

#expressionObject (readonly)

The expression to alias



974
975
976
# File 'lib/sequel/sql.rb', line 974

def expression
  @expression
end