This method is deprecated or moved on the latest stable version. The last existing version (1.1.4) is shown here.
subclass(base_name, &body)
Creates a new subclass of self, with a name "under" our own name. Example:
x = Foo::Bar.subclass('Zap'){} x.name # => Foo::Bar::Zap_1 x.superclass.name # => Foo::Bar
# File lib/spec/extensions/class.rb, line 8 def subclass(base_name, &body) klass = Class.new(self) class_name = "#{base_name}_#{class_count!}" instance_eval do const_set(class_name, klass) end klass.instance_eval(&body) klass end