Module: Mutant::MethodObject
Overview
A mixing to create method object semantics
Class Method Summary collapse
-
.extended(descendant) ⇒ undefined
private
Hook called when descendant is extended.
Instance Method Summary collapse
-
#run(*args) ⇒ Objecct
private
Run the method object.
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
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
27 28 29 |
# File 'lib/mutant/support/method_object.rb', line 27 def run(*args) new(*args) end |