Inversion::

AbstractClass

module
Extended With
Inversion::AbstractClass::ClassMethods
Inversion::AbstractClass::ClassMethods

Hides your class's ::new method and adds a pure_virtual method generator for defining API methods. If subclasses of your class don't provide implementations of “pure_virtual” methods, NotImplementedErrors will be raised if they are called.

# AbstractClass
class MyBaseClass
    include Inversion::AbstractClass

    # Define a method that will raise a NotImplementedError if called
    pure_virtual :api_method
end

Public Class Methods

anchor
included( mod )

Inclusion callback

# File lib/inversion/mixins.rb, line 50
def self::included( mod )
        super
        if mod.respond_to?( :new )
                mod.extend( ClassMethods )
                mod.module_eval { private_class_method :new }
        end
end