Module: Mutant::MethodObject

Included in:
Loader, Runner
Defined in:
lib/mutant/support/method_object.rb

Overview

A mixing to create method object semantics

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(descendant) ⇒ undefined

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.

Hook called when descendant is extended

Parameters:

  • descendant (Module|Class)

Returns:

  • (undefined)


12
13
14
15
16
# File 'lib/mutant/support/method_object.rb', line 12

def self.extended(descendant)
  descendant.class_eval do
    private_class_method :new
  end
end

Instance Method Details

#run(*args) ⇒ Objecct

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.

Run the method object

Not aliased to prevent problems from inheritance

Returns:

  • (Objecct)

    returns the created object



27
28
29
# File 'lib/mutant/support/method_object.rb', line 27

def run(*args)
  new(*args)
end