Class: Hash19::LazyValue

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

Instance Method Summary collapse

Constructor Details

#initialize(callable) ⇒ LazyValue

Returns a new instance of LazyValue.



3
4
5
# File 'lib/hash19/lazy_value.rb', line 3

def initialize(callable)
  @block = callable
end

Instance Method Details

#valueObject



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

def value
  @block.call
end