Class: Famili::LazyValue
- Inherits:
-
Object
- Object
- Famili::LazyValue
- Defined in:
- lib/famili/lazy_value.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize ⇒ LazyValue
constructor
A new instance of LazyValue.
Constructor Details
#initialize ⇒ LazyValue
Returns a new instance of LazyValue.
3 4 5 |
# File 'lib/famili/lazy_value.rb', line 3 def initialize @block = proc end |
Instance Method Details
#call ⇒ Object
7 8 9 |
# File 'lib/famili/lazy_value.rb', line 7 def call @value ||= @block.call end |