Class Sequel::SQL::DelayedEvaluation
In: lib/sequel/sql.rb
Parent: GenericExpression

Represents a delayed evaluation, encapsulating a callable object which returns the value to use when called.

Methods

call   new  

Attributes

callable  [R]  A callable object that returns the value of the evaluation when called.

Public Class methods

Set the callable object

[Source]

      # File lib/sequel/sql.rb, line 1292
1292:       def initialize(callable)
1293:         @callable = callable
1294:       end

Public Instance methods

Call the underlying callable and return the result. If the underlying callable only accepts a single argument, call it with the given dataset.

[Source]

      # File lib/sequel/sql.rb, line 1299
1299:       def call(ds)
1300:         if @callable.respond_to?(:arity) && @callable.arity == 1
1301:           @callable.call(ds)
1302:         else
1303:           @callable.call
1304:         end
1305:       end

[Validate]