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
librarianp-1.1.2 lib/librarian/support/abstract_method.rb
librarianp-1.1.1 lib/librarian/support/abstract_method.rb
librarianp-1.1.0 lib/librarian/support/abstract_method.rb
librarianp-1.0.0 lib/librarian/support/abstract_method.rb
librarianp-0.6.4 lib/librarian/support/abstract_method.rb
librarianp-0.6.3 lib/librarian/support/abstract_method.rb
librarianp-0.6.2 lib/librarian/support/abstract_method.rb
librarianp-0.6.1 lib/librarian/support/abstract_method.rb
librarianp-0.6.0 lib/librarian/support/abstract_method.rb
librarianp-0.5.1 lib/librarian/support/abstract_method.rb
librarianp-0.5.0 lib/librarian/support/abstract_method.rb
librarianp-0.4.0 lib/librarian/support/abstract_method.rb
librarianp-0.3.0 lib/librarian/support/abstract_method.rb
librarianp-0.2.0 lib/librarian/support/abstract_method.rb
librarianp-0.1.2 lib/librarian/support/abstract_method.rb
librarian-0.1.2 lib/librarian/support/abstract_method.rb
librarian-puppet-0.9.10 vendor/librarian/lib/librarian/support/abstract_method.rb
librarian-0.1.1 lib/librarian/support/abstract_method.rb
librarian-puppet-0.9.9 vendor/librarian/lib/librarian/support/abstract_method.rb
librarian-0.1.0 lib/librarian/support/abstract_method.rb