Inversion::AbstractClass::
ClassMethods
module
Methods to be added to including classes
Turn subclasses’ new methods back to public.
def inherited( subclass )
subclass.module_eval { public_class_method :new }
super
end
Define one or more “virtual” methods which will raise NotImplementedErrors when called via a concrete subclass.
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