Module: AbstractClass

Defined in:
lib/simple_abstract.rb

Defined Under Namespace

Classes: NoImplementError

Class Method Summary collapse

Class Method Details

.included(abstract) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/simple_abstract.rb', line 5

def self.included abstract
  abstract.instance_eval do
    def self.included base
      @abstract_methods.each do |ab|
        unless base.instance_methods.include? ab.to_s
          raise AbstractClass::NoImplementError
        end
      end
    end
  end
end