Class: Sequel::SQL::NumericExpression

Inherits:
ComplexExpression show all
Includes:
BitwiseMethods, InequalityMethods, NumericMethods
Defined in:
lib/sequel/sql.rb

Overview

Subclass of ComplexExpression where the expression results in a numeric value in SQL.

Constant Summary

Constants inherited from ComplexExpression

ComplexExpression::BITWISE_OPERATORS, ComplexExpression::BOOLEAN_OPERATOR_METHODS, ComplexExpression::CONSTANT_INVERSIONS, ComplexExpression::CUSTOM_EXPRESSIONS, ComplexExpression::EQUALITY_OPERATORS, ComplexExpression::INEQUALITY_OPERATORS, ComplexExpression::IN_OPERATORS, ComplexExpression::IS_OPERATORS, ComplexExpression::LIKE_OPERATORS, ComplexExpression::MATHEMATICAL_OPERATORS, ComplexExpression::N_ARITY_OPERATORS, ComplexExpression::ONE_ARITY_OPERATORS, ComplexExpression::OPERTATOR_INVERSIONS, ComplexExpression::REGEXP_OPERATORS, ComplexExpression::TWO_ARITY_OPERATORS

Instance Attribute Summary

Attributes inherited from ComplexExpression

#args, #op

Instance Method Summary collapse

Methods included from BitwiseMethods

#~

Methods inherited from ComplexExpression

#initialize, #sql_boolean, #sql_string

Methods included from SubscriptMethods

#sql_subscript

Methods included from PatternMatchMethods

#=~

Methods included from OrderMethods

#asc, #desc

Methods included from CastMethods

#cast, #cast_numeric, #cast_string

Methods included from AliasMethods

#as

Methods inherited from Expression

#==, attr_reader, #eql?, #hash, inherited, #inspect, #lit, #sql_literal

Constructor Details

This class inherits a constructor from Sequel::SQL::ComplexExpression

Instance Method Details

#+(ce) ⇒ Object

Always use + for + operator for NumericExpressions.



1532
1533
1534
# File 'lib/sequel/sql.rb', line 1532

def +(ce)
  NumericExpression.new(:+, self, ce)
end

#sql_numberObject

Return self instead of creating a new object to save on memory.



1537
1538
1539
# File 'lib/sequel/sql.rb', line 1537

def sql_number
  self
end