class Sequel::SQL::DelayedEvaluation
Represents a delayed evaluation, encapsulating a callable object which returns the value to use when called.
Attributes
A callable object that returns the value of the evaluation when called.
Public Class Methods
Source
# File lib/sequel/sql.rb 1350 def initialize(callable) 1351 @callable = callable 1352 freeze 1353 end
Set the callable object
Public Instance Methods
Source
# File lib/sequel/sql.rb 1358 def call(ds) 1359 if @callable.respond_to?(:arity) && @callable.arity == 1 1360 @callable.call(ds) 1361 else 1362 @callable.call 1363 end 1364 end
Call the underlying callable and return the result. If the underlying callable only accepts a single argument, call it with the given dataset.