Sha256: d09cc13f37ae837924226b81c9400e05ca70ee1857247354aeac708470f1efe7

Contents?: true

Size: 456 Bytes

Versions: 66

Compression:

Stored size: 456 Bytes

Contents

module Librarian
  module Support
    module AbstractMethod

      class << self
        def included(base)
          base.extend ClassMethods
        end
      end

      module ClassMethods
        def abstract_method(*names)
          names.reject{|name| respond_to?(name)}.each do |name, *args|
            define_method(name) { raise Exception, "Method #{self.class.name}##{name} is abstract!" }
          end
        end
      end

    end
  end
end

Version data entries

66 entries across 66 versions & 5 rubygems

Version Path
librarian-0.0.6 lib/librarian/support/abstract_method.rb
librarian-0.0.5 lib/librarian/support/abstract_method.rb
librarian-0.0.4 lib/librarian/support/abstract_method.rb
librarian-0.0.3 lib/librarian/support/abstract_method.rb
librarian-0.0.2 lib/librarian/support/abstract_method.rb
librarian-0.0.1 lib/librarian/support/abstract_method.rb