Class: Sequel::SQL::Function
- Inherits:
-
Expression
- Object
- Expression
- Sequel::SQL::Function
- Includes:
- ComplexExpressionMethods
- Defined in:
- lib/sequel_core/sql.rb
Overview
Represents an SQL function call.
Constant Summary
Constants included from ColumnMethods
ColumnMethods::AS, ColumnMethods::ASC, ColumnMethods::DESC
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
The array of arguments to pass to the function (may be blank).
-
#f ⇒ Object
readonly
The SQL function to call.
Instance Method Summary collapse
-
#==(x) ⇒ Object
Functions are considered equivalent if they have the same class, function, and arguments.
-
#initialize(f, *args) ⇒ Function
constructor
Set the attributes to the given arguments.
-
#to_s(ds) ⇒ Object
Delegate the creation of the resulting SQL to the given dataset, since it may be database dependent.
Methods included from ComplexExpressionMethods
#sql_boolean, #sql_number, #sql_string
Methods included from StringMethods
Methods included from BooleanMethods
Methods inherited from Expression
Methods included from ColumnMethods
Constructor Details
#initialize(f, *args) ⇒ Function
Set the attributes to the given arguments
431 432 433 |
# File 'lib/sequel_core/sql.rb', line 431 def initialize(f, *args) @f, @args = f, args end |
Instance Attribute Details
#args ⇒ Object (readonly)
The array of arguments to pass to the function (may be blank)
425 426 427 |
# File 'lib/sequel_core/sql.rb', line 425 def args @args end |
#f ⇒ Object (readonly)
The SQL function to call
428 429 430 |
# File 'lib/sequel_core/sql.rb', line 428 def f @f end |
Instance Method Details
#==(x) ⇒ Object
Functions are considered equivalent if they have the same class, function, and arguments.
437 438 439 |
# File 'lib/sequel_core/sql.rb', line 437 def ==(x) x.class == self.class && @f == x.f && @args == x.args end |
#to_s(ds) ⇒ Object
Delegate the creation of the resulting SQL to the given dataset, since it may be database dependent.
443 444 445 |
# File 'lib/sequel_core/sql.rb', line 443 def to_s(ds) ds.function_sql(self) end |