Class: Sequel::SQL::Function

Inherits:
GenericExpression show all
Defined in:
lib/sequel/lib/sequel/sql.rb

Overview

Represents an SQL function call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SubscriptMethods

#sql_subscript

Methods included from StringMethods

#ilike, #like

Methods included from OrderMethods

#asc, #desc

Methods included from ComplexExpressionMethods

#extract, #sql_boolean, #sql_number, #sql_string

Methods included from CastMethods

#cast, #cast_numeric, #cast_string

Methods included from BooleanMethods

#~

Methods included from AliasMethods

#as

Methods inherited from Expression

#lit

Constructor Details

#initialize(f, *args) ⇒ Function

Set the attributes to the given arguments



558
559
560
# File 'lib/sequel/lib/sequel/sql.rb', line 558

def initialize(f, *args)
  @f, @args = f, args
end

Instance Attribute Details

#argsObject (readonly)

The array of arguments to pass to the function (may be blank)



552
553
554
# File 'lib/sequel/lib/sequel/sql.rb', line 552

def args
  @args
end

#fObject (readonly)

The SQL function to call



555
556
557
# File 'lib/sequel/lib/sequel/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/lib/sequel/sql.rb', line 564

def ==(x)
   x.class == self.class && @f == x.f && @args == x.args
end