Class: Sequel::SQL::Function
- Inherits:
-
GenericExpression
- Object
- Expression
- GenericExpression
- Sequel::SQL::Function
- Defined in:
- lib/sequel_core/sql.rb
Overview
Represents an SQL function call.
Direct Known Subclasses
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
#extract, #sql_boolean, #sql_number, #sql_string
Methods included from StringMethods
Methods included from BooleanMethods
Methods included from OrderMethods
Methods included from CastMethods
#cast, #cast_numeric, #cast_string
Methods included from AliasMethods
Methods inherited from Expression
Constructor Details
#initialize(f, *args) ⇒ Function
Set the attributes to the given arguments
558 559 560 |
# File 'lib/sequel_core/sql.rb', line 558 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)
552 553 554 |
# File 'lib/sequel_core/sql.rb', line 552 def args @args end |
#f ⇒ Object (readonly)
The SQL function to call
555 556 557 |
# File 'lib/sequel_core/sql.rb', line 555 def f @f end |
Instance Method Details
#==(x) ⇒ Object
Functions are considered equivalent if they have the same class, function, and arguments.
564 565 566 |
# File 'lib/sequel_core/sql.rb', line 564 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.
570 571 572 |
# File 'lib/sequel_core/sql.rb', line 570 def to_s(ds) ds.function_sql(self) end |