Class: Famili::LazyValue

Inherits:
Object
  • Object
show all
Defined in:
lib/famili/lazy_value.rb

Instance Method Summary collapse

Constructor Details

#initializeLazyValue

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

#callObject



7
8
9
# File 'lib/famili/lazy_value.rb', line 7

def call
  @value ||= @block.call
end