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.



1043
1044
1045
1046
1047
1048
# File 'lib/sequel/sql.rb', line 1043

def initialize(expression, aliaz, columns=nil)
  @expression = expression
  @aliaz = aliaz
  @columns = columns
  freeze
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.



1035
1036
1037
# File 'lib/sequel/sql.rb', line 1035

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).



1040
1041
1042
# File 'lib/sequel/sql.rb', line 1040

def columns
  @columns
end

#expressionObject (readonly)

The expression to alias



1031
1032
1033
# File 'lib/sequel/sql.rb', line 1031

def expression
  @expression
end