class Pry::Config::MemoizedValue
@see Pry::Config::LazyValue
@since v0.13.0
@api private
value.call # => 20
value.call # => 20
value.call # => 20
value = Pry::Config::MemoizedValue.new { num += 1 }
num = 19
@example
result.
configuration value. Subsequent ‘#call` calls return the same memoized
MemoizedValue is a Proc (block) wrapper. It is meant to be used as a
def call
def call return @call if @called @called = true @call = @block.call end
def initialize(&block)
def initialize(&block) @block = block @called = false @call = nil end