Method: PryTest::TestWrapper#create_method

Defined in:
lib/pry-test/test_wrapper.rb

#create_method(name) { ... } ⇒ Object

Creates a method on this instance.

Parameters:

  • name (Symbol)

    The name of the method.

Yields:

  • The block of code that will serve as the method’s implementation.



26
27
28
29
# File 'lib/pry-test/test_wrapper.rb', line 26

def create_method(name, &block)
  eigen = class << self; self; end
  eigen.send(:define_method, name, &block)
end