Special spice that calls out to a block to get it’s argument. The block is called each time an argument is required. Unlike the other spices, this must be instantiated with the block you want lazily evaluated.
Methods
Public Class methods
[ show source ]
# File lib/curry.rb, line 121
121: def initialize( &promise )
122: super("LAZYSPICE")
123: @promise = promise
124: end
Public Instance methods
[ show source ]
# File lib/curry.rb, line 126
126: def spice_arg( args ) # called to provide the missing argument
127: [@promise.call(args)]
128: end