Class: Stub::Abstract
- Inherits:
-
Object
- Object
- Stub::Abstract
- Defined in:
- lib/stub/abstract.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Methods
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(object) ⇒ Abstract
constructor
A new instance of Abstract.
Constructor Details
#initialize(object) ⇒ Abstract
Returns a new instance of Abstract.
11 12 13 14 15 16 17 18 19 |
# File 'lib/stub/abstract.rb', line 11 def initialize object @object = object @stub_class = self.class singleton_class = self.singleton_class methods.each &singleton_class.method(:undef_method) singleton_class.send :include, @stub_class.const_get(:Methods) end |
Class Method Details
.inherited(subclass) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/stub/abstract.rb', line 3 def self.inherited subclass eval <<-RUBY module #{subclass}::Methods include #{self}::Methods end RUBY end |