Class: LazyList::Promise
Overview
A promise that can be evaluated on demand (if forced).
Direct Known Subclasses
Instance Method Summary collapse
-
#__value__ ⇒ Object
Return the value of this Promise.
-
#initialize(&block) ⇒ Promise
constructor
A new instance of Promise.
-
#method_missing(*args, &block) ⇒ Object
Redirect all missing methods to the value of this Promise.
Constructor Details
#initialize(&block) ⇒ Promise
Returns a new instance of Promise.
197 198 199 |
# File 'lib/lazylist.rb', line 197 def initialize(&block) @block = block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
Redirect all missing methods to the value of this Promise.
212 213 214 |
# File 'lib/lazylist.rb', line 212 def method_missing( *args, &block ) __value__.__send__( *args, &block ) end |