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 1355 def initialize(callable) 1356 @callable = callable 1357 freeze 1358 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 1363 def call(ds) 1364 if @callable.respond_to?(:arity) && @callable.arity == 1 1365 @callable.call(ds) 1366 else 1367 @callable.call 1368 end 1369 end