module Pry::Memory::Strategy

Class responsible for generating

variable names

@example

Pry::Memory::Strategy.variable_name
# => 'a'
Pry::Memory::Strategy.next!
Pry::Memory::Strategy.variable_name
# => 'b'

Attributes

strategy[R]

Public Instance Methods

configure(strategy, &block) click to toggle source
# 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!() click to toggle source
# File lib/pry/memory/strategy.rb, line 29
def next!
  strategy.next!
end
variable_name() click to toggle source
# File lib/pry/memory/strategy.rb, line 25
def variable_name
  strategy.generate
end