Sha256: 839cf26d78b672a9494a5b927032a1766768c0d0f5f80ab4b2e08d9b7781a2a0

Contents?: true

Size: 594 Bytes

Versions: 18

Compression:

Stored size: 594 Bytes

Contents

module Mutant
  # A mixing to create method object semantics
  module MethodObject
    # Hook called when descendant is extended
    #
    # @param [Module|Class] descendant
    #
    # @return [undefined]
    #
    # @api private
    #
    def self.extended(descendant)
      descendant.class_eval do
        private_class_method :new
      end
    end

    # Run the method object
    #
    # Not aliased to prevent problems from inheritance
    #
    # @return [Objecct]
    #   returns the created object
    #
    # @api private
    #
    def run(*args)
      new(*args)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mutant-0.2.20 lib/mutant/support/method_object.rb
mutant-0.2.17 lib/mutant/support/method_object.rb
mutant-0.2.16 lib/mutant/support/method_object.rb
mutant-0.2.15 lib/mutant/support/method_object.rb
mutant-0.2.14 lib/mutant/support/method_object.rb
mutant-0.2.13 lib/mutant/support/method_object.rb
mutant-0.2.12 lib/mutant/support/method_object.rb
mutant-0.2.11 lib/mutant/support/method_object.rb
mutant-0.2.9 lib/mutant/support/method_object.rb
mutant-0.2.8 lib/mutant/support/method_object.rb
mutant-0.2.7 lib/mutant/support/method_object.rb
mutant-0.2.6 lib/mutant/support/method_object.rb
mutant-0.2.5 lib/mutant/support/method_object.rb
mutant-0.2.4 lib/mutant/support/method_object.rb
mutant-0.2.3 lib/mutant/support/method_object.rb
mutant-0.2.2 lib/mutant/support/method_object.rb
mutant-0.2.1 lib/mutant/support/method_object.rb
mutant-0.2.0 lib/mutant/support/method_object.rb