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.



982
983
984
985
986
# File 'lib/sequel/sql.rb', line 982

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.



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

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



979
980
981
# File 'lib/sequel/sql.rb', line 979

def columns
  @columns
end

#expressionObject (readonly)

The expression to alias



970
971
972
# File 'lib/sequel/sql.rb', line 970

def expression
  @expression
end