Module: Pry::Memory::Strategy
Overview
Class responsible for generating
variable names
Instance Attribute Summary collapse
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Instance Method Summary collapse
Instance Attribute Details
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
24 25 26 |
# File 'lib/pry/memory/strategy.rb', line 24 def strategy @strategy end |
Instance Method Details
#configure(strategy, &block) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/pry/memory/strategy.rb', line 14 def configure(strategy, &block) @strategy = if strategy Pry::Memory::Generators::PREDEFINED[strategy] elsif block_given? Pry::Memory::Generators.new(&block) else raise "Strategy must be specified using Symbol or block" end end |
#next! ⇒ Object
29 30 31 |
# File 'lib/pry/memory/strategy.rb', line 29 def next! strategy.next! end |
#variable_name ⇒ Object
25 26 27 |
# File 'lib/pry/memory/strategy.rb', line 25 def variable_name strategy.generate end |