Class: Symbol

Instance Method Summary collapse

Methods included from Sequel::SQL::ComplexExpressionMethods

#extract, #sql_boolean, #sql_number, #sql_string

Methods included from Sequel::SQL::StringMethods

#ilike, #like

Methods included from Sequel::SQL::BooleanMethods

#~

Methods included from Sequel::SQL::OrderMethods

#asc, #desc

Methods included from Sequel::SQL::CastMethods

#cast, #cast_as, #cast_numeric, #cast_string

Methods included from Sequel::SQL::AliasMethods

#as

Methods included from Sequel::SQL::IdentifierMethods

#identifier

Methods included from Sequel::SQL::QualifyingMethods

#qualify

Instance Method Details

#*(ce = (arg=false;nil)) ⇒ Object

If no argument is given, returns a Sequel::SQL::ColumnAll object specifying all columns for this table. If an argument is given, returns a Sequel::SQL::NumericExpression using the * (multiplication) operator with this and the given argument.



167
168
169
170
# File 'lib/sequel/core_sql.rb', line 167

def *(ce=(arg=false;nil))
  return super(ce) unless arg == false
  Sequel::SQL::ColumnAll.new(self);
end

#sql_function(*args) ⇒ Object Also known as: []

Returns a Sequel::SQL::Function with this as the function name, and the given arguments. This is aliased as Symbol#[] if ruby 1.9 is not being used. ruby 1.9 includes Symbol#[], and Sequel doesn’t override methods defined by ruby itself.



176
177
178
# File 'lib/sequel/core_sql.rb', line 176

def sql_function(*args)
  Sequel::SQL::Function.new(self, *args)
end

#sql_subscript(*sub) ⇒ Object

Return an SQL array subscript with the given arguments.



182
183
184
# File 'lib/sequel/core_sql.rb', line 182

def sql_subscript(*sub)
  Sequel::SQL::Subscript.new(self, sub.flatten)
end

#to_column_ref(ds) ⇒ Object



391
392
393
394
# File 'lib/sequel/deprecated.rb', line 391

def to_column_ref(ds)
  Sequel::Deprecation.deprecate('Symbol#to_column_ref', 'Use Dataset#literal')
  ds.literal(self)
end

#|(sub) ⇒ Object



385
386
387
388
389
# File 'lib/sequel/deprecated.rb', line 385

def |(sub)
  return super unless (Integer === sub) || ((Array === sub) && sub.any?{|x| Integer === x})
  Sequel::Deprecation.deprecate('The use of Symbol#| for SQL array subscripts', 'Use Symbol#sql_subscript')
  Sequel::SQL::Subscript.new(self, Array(sub))
end