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::ASSOCIATIVE_OPERATORS, 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::OPERATOR_INVERSIONS, 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 NumericMethods

#coerce

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, #clone, #eql?, #hash, inherited, #inspect

Constructor Details

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

Instance Method Details

#+(ce) ⇒ Object

Always use + for + operator for NumericExpressions.



1649
1650
1651
# File 'lib/sequel/sql.rb', line 1649

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

#sql_numberObject

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



1654
1655
1656
# File 'lib/sequel/sql.rb', line 1654

def sql_number
  self
end