Class: Hash19::LazyValue
- Inherits:
-
Object
- Object
- Hash19::LazyValue
- Defined in:
- lib/hash19/lazy_value.rb
Instance Method Summary collapse
-
#initialize(callable) ⇒ LazyValue
constructor
A new instance of LazyValue.
- #value ⇒ Object
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
#value ⇒ Object
7 8 9 |
# File 'lib/hash19/lazy_value.rb', line 7 def value @block.call end |