Inversion::AbstractClass::

ClassMethods module

Methods to be added to including classes

Public Instance Methods

inherited( subclass )

Turn subclasses’ new methods back to public.

# File lib/inversion/mixins.rb, line 38
def inherited( subclass )
        subclass.module_eval { public_class_method :new }
        super
end
pure_virtual( *syms )

Define one or more “virtual” methods which will raise NotImplementedErrors when called via a concrete subclass.

# File lib/inversion/mixins.rb, line 26
def pure_virtual( *syms )
        syms.each do |sym|
                define_method( sym ) do |*args|
                        raise ::NotImplementedError,
                                "%p does not provide an implementation of #%s" % [ self.class, sym ],
                                caller(1)
                end
        end
end