Methods

Inversion::AbstractClass

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

included( mod ) click to toggle source

Inclusion callback

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.