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, #eql?, #hash, inherited, #inspect, #lit, #sql_literal

Constructor Details

#initialize(expression, aliaz, columns = nil) ⇒ AliasedExpression

Create an object with the given expression and alias.



1019
1020
1021
1022
1023
# File 'lib/sequel/sql.rb', line 1019

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

Instance Attribute Details

#aliazObject (readonly) Also known as: alias

The alias to use for the expression, not alias since that is a keyword in ruby.



1011
1012
1013
# File 'lib/sequel/sql.rb', line 1011

def aliaz
  @aliaz
end

#columnsObject (readonly)

The columns aliases to use, for when the aliased expression is a record or set of records (such as a dataset).



1016
1017
1018
# File 'lib/sequel/sql.rb', line 1016

def columns
  @columns
end

#expressionObject (readonly)

The expression to alias



1007
1008
1009
# File 'lib/sequel/sql.rb', line 1007

def expression
  @expression
end