Inversion::AbstractClass::

ClassMethods

module

Methods to be added to including classes

Public Instance Methods

anchor
inherited( subclass )

Turn subclasses' new methods back to public.

# File lib/inversion/mixins.rb, line 39
def inherited( subclass )
        subclass.module_eval { public_class_method :new }
        super
end
anchor
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 27
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