Class: Pry::Config::Lazy Private

Inherits:
Object show all
Defined in:
lib/pry/config.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Wraps a block so it can have a name.

Examples:

proc1 = proc {}
proc2 = Pry::Config::Lazy.new(&proc {})

proc1.is_a?(Pry::Config::Lazy)
#=> false
proc2.is_a?(Pry::Config::Lazy)
#=> true

Since:

  • v0.12.0

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Lazy

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Lazy.

Since:

  • v0.12.0



19
20
21
# File 'lib/pry/config.rb', line 19

def initialize(&block)
  @block = block
end

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • v0.12.0



24
25
26
# File 'lib/pry/config.rb', line 24

def call
  @block.call
end