Files
news.gitea.happylizard.me/bin/gems/pry-0.15.2/lib/pry/config/lazy_value.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

30 lines
620 B
Ruby

# frozen_string_literal: true
class Pry
class Config
# 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
class LazyValue
def initialize(&block)
@block = block
end
def call
@block.call
end
end
end
end