Module: Veritas::SQL::Generator::Function::Numeric
- Includes:
- Veritas::SQL::Generator::Function
- Included in:
- Relation::Unary
- Defined in:
- lib/veritas/sql/generator/function/numeric.rb
Overview
Generates an SQL statement for a numeric function
Constant Summary collapse
- ABSOLUTE =
'ABS'.freeze
- ADD =
'+'.freeze
- SUBTRACT =
'-'.freeze
- MULTIPLY =
'*'.freeze
- DIVIDE =
'/'.freeze
- POWER =
'POWER'.freeze
- MOD =
'MOD'.freeze
- SQUARE_ROOT =
'SQRT'.freeze
Constants included from Identifier
Identifier::ESCAPED_QUOTE, Identifier::QUOTE
Constants included from Literal
Literal::ESCAPED_QUOTE, Literal::FALSE, Literal::NULL, Literal::QUOTE, Literal::SEPARATOR, Literal::TIME_SCALE, Literal::TRUE
Instance Method Summary collapse
-
#visit_veritas_function_numeric_absolute(absolute) ⇒ #to_s
private
Visit an Absolute function.
-
#visit_veritas_function_numeric_addition(addition) ⇒ #to_s
private
Visit an Addition function.
-
#visit_veritas_function_numeric_division(division) ⇒ #to_s
private
Visit a Division function.
-
#visit_veritas_function_numeric_exponentiation(exponentiation) ⇒ #to_s
private
Visit a Exponentiation function.
-
#visit_veritas_function_numeric_modulo(modulo) ⇒ #to_s
private
Visit a Modulo function.
-
#visit_veritas_function_numeric_multiplication(multiplication) ⇒ #to_s
private
Visit a Multiplication function.
-
#visit_veritas_function_numeric_square_root(square_root) ⇒ #to_s
private
Visit a Square Root function.
-
#visit_veritas_function_numeric_subtraction(subtraction) ⇒ #to_s
private
Visit an Addition function.
-
#visit_veritas_function_numeric_unary_minus(unary_minus) ⇒ #to_s
private
Visit an Unary Minus function.
-
#visit_veritas_function_numeric_unary_plus(unary_plus) ⇒ #to_s
private
Visit an Unary Plus function.
Methods included from Attribute
Methods included from Identifier
Methods included from Literal
dup_frozen, #visit_class, #visit_date, #visit_date_time, #visit_enumerable, #visit_false_class, #visit_nil_class, #visit_numeric, #visit_string, #visit_time, #visit_true_class
Instance Method Details
#visit_veritas_function_numeric_absolute(absolute) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit an Absolute function
28 29 30 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 28 def visit_veritas_function_numeric_absolute(absolute) unary_prefix_operation_sql(ABSOLUTE, absolute) end |
#visit_veritas_function_numeric_addition(addition) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit an Addition function
39 40 41 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 39 def visit_veritas_function_numeric_addition(addition) Generator.parenthesize!(binary_infix_operation_sql(ADD, addition)) end |
#visit_veritas_function_numeric_division(division) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit a Division function
50 51 52 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 50 def visit_veritas_function_numeric_division(division) Generator.parenthesize!(binary_infix_operation_sql(DIVIDE, division)) end |
#visit_veritas_function_numeric_exponentiation(exponentiation) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit a Exponentiation function
61 62 63 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 61 def visit_veritas_function_numeric_exponentiation(exponentiation) binary_prefix_operation_sql(POWER, exponentiation) end |
#visit_veritas_function_numeric_modulo(modulo) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit a Modulo function
72 73 74 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 72 def visit_veritas_function_numeric_modulo(modulo) binary_prefix_operation_sql(MOD, modulo) end |
#visit_veritas_function_numeric_multiplication(multiplication) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit a Multiplication function
83 84 85 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 83 def visit_veritas_function_numeric_multiplication(multiplication) Generator.parenthesize!(binary_infix_operation_sql(MULTIPLY, multiplication)) end |
#visit_veritas_function_numeric_square_root(square_root) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit a Square Root function
94 95 96 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 94 def visit_veritas_function_numeric_square_root(square_root) unary_prefix_operation_sql(SQUARE_ROOT, square_root) end |
#visit_veritas_function_numeric_subtraction(subtraction) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit an Addition function
105 106 107 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 105 def visit_veritas_function_numeric_subtraction(subtraction) Generator.parenthesize!(binary_infix_operation_sql(SUBTRACT, subtraction)) end |
#visit_veritas_function_numeric_unary_minus(unary_minus) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit an Unary Minus function
116 117 118 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 116 def visit_veritas_function_numeric_unary_minus(unary_minus) unary_prefix_operation_sql(SUBTRACT, unary_minus) end |
#visit_veritas_function_numeric_unary_plus(unary_plus) ⇒ #to_s
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Visit an Unary Plus function
127 128 129 |
# File 'lib/veritas/sql/generator/function/numeric.rb', line 127 def visit_veritas_function_numeric_unary_plus(unary_plus) unary_prefix_operation_sql(ADD, unary_plus) end |