blob: b32a196ed7ff46b7edd27df13aee51eec189e7cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# frozen_string_literal: true
class Pry
class Config
# Value holds a value for the given attribute and decides how it should
# be read. Procs get called, other values are returned as is.
#
# @since v0.13.0
# @api private
class Value
def initialize(value)
@value = value
end
def call
unless [Config::MemoizedValue, Config::LazyValue].include?(@value.class)
return @value
end
@value.call
end
end
end
end
|