class Pry::Config::LazyValue

LazyValue is a Proc (block) wrapper. It is meant to be used as a configuration value. Subsequent `#call` calls always evaluate the given block.

@example

num = 19
value = Pry::Config::LazyValue.new { num += 1 }
value.foo # => 20
value.foo # => 21
value.foo # => 22

@api private @since v0.13.0 @see Pry::Config::MemoizedValue

Public Class Methods

new(&block) click to toggle source
# File lib/pry/config/lazy_value.rb, line 20
def initialize(&block)
  @block = block
end

Public Instance Methods

call() click to toggle source
# File lib/pry/config/lazy_value.rb, line 24
def call
  @block.call
end