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.
callable | [R] | A callable object that returns the value of the evaluation when called. |
Set the callable object
# File lib/sequel/sql.rb, line 1292 1292: def initialize(callable) 1293: @callable = callable 1294: end
Call the underlying callable and return the result. If the underlying callable only accepts a single argument, call it with the given dataset.
# 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