Represents a delayed evaluation, encapsulating a callable object which returns the value to use when called.
Attributes
callable | [R] |
A callable object that returns the value of the evaluation when called. |
Public Class methods
new(callable)
Set the callable object
[show source]
# File lib/sequel/sql.rb 1341 def initialize(callable) 1342 @callable = callable 1343 freeze 1344 end
Public Instance methods
call(ds)
Call the underlying callable and return the result. If the underlying callable only accepts a single argument, call it with the given dataset.
[show source]
# File lib/sequel/sql.rb 1349 def call(ds) 1350 if @callable.respond_to?(:arity) && @callable.arity == 1 1351 @callable.call(ds) 1352 else 1353 @callable.call 1354 end 1355 end