Module: Sequel::SQL::ComplexExpressionMethods

Includes:
BooleanMethods, InequalityMethods, NumericMethods, StringMethods
Included in:
LiteralString, Function, Symbol
Defined in:
lib/sequel_core/sql.rb

Overview

This module includes other Sequel::SQL::*Methods modules and is included in other classes that are could be either booleans, strings, or numbers. It also adds three methods so that can specify behavior in case one of the operator methods has been overridden (such as Symbol#/).

For example, if Symbol#/ is overridden to produce a string (for example, to make file system path creation easier), the following code will not do what you want:

:price/10 > 100

In that case, you need to do the following:

:price.sql_number/10 > 100

Instance Method Summary collapse

Methods included from StringMethods

#ilike, #like

Methods included from BooleanMethods

#~

Instance Method Details

#sql_booleanObject

Return a BooleanExpression representation of self.



304
305
306
# File 'lib/sequel_core/sql.rb', line 304

def sql_boolean
  BooleanExpression.new(:NOOP, self)
end

#sql_numberObject

Return a NumericExpression representation of self.



309
310
311
# File 'lib/sequel_core/sql.rb', line 309

def sql_number
  NumericExpression.new(:NOOP, self)
end

#sql_stringObject

Return a StringExpression representation of self.



314
315
316
# File 'lib/sequel_core/sql.rb', line 314

def sql_string
  StringExpression.new(:NOOP, self)
end