Sha256: a72ca543289c58d5c3a87a50ead98d5ae56829b26379cc62db0fa113ed09a1d7

Contents?: true

Size: 1.03 KB

Versions: 30

Compression:

Stored size: 1.03 KB

Contents

module Qa::Authorities
  ##
  # @abstract The base class for all authorites. Implementing subclasses must
  #   provide {#all} and #{find} methods.
  # @todo What about {#search}?
  class Base
    ##
    # @abstract By default, #all is not implemented. A subclass authority must
    #   implement this method to conform to the generic interface.
    #
    # @return [Enumerable]
    # @raise [NotImplementedError] when this method is abstract.
    #
    # @todo better specify return type
    def all
      raise NotImplementedError, "#{self.class}#all is unimplemented."
    end

    ##
    # @abstract By default, #find is not implemented. A subclass authority must
    #   implement this method to conform to the generic interface.
    #
    # @param id [String] the id string for the authority to lookup
    #
    # @return [Hash]
    # @raise [NotImplementedError] when this method is abstract.
    #
    # @todo better specify return type
    def find(_id)
      raise NotImplementedError, "#{self.class}#find is unimplemented."
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
qa-5.13.0 lib/qa/authorities/base.rb
qa-5.12.0 lib/qa/authorities/base.rb
qa-5.11.0 lib/qa/authorities/base.rb
qa-5.10.0 lib/qa/authorities/base.rb
qa-5.9.0 lib/qa/authorities/base.rb
qa-5.8.1 lib/qa/authorities/base.rb
qa-5.8.0 lib/qa/authorities/base.rb
qa-5.7.0 lib/qa/authorities/base.rb
qa-5.6.0 lib/qa/authorities/base.rb
qa-5.5.2 lib/qa/authorities/base.rb
qa-4.3.0 lib/qa/authorities/base.rb
qa-5.5.1 lib/qa/authorities/base.rb
qa-5.5.0 lib/qa/authorities/base.rb
qa-5.4.0 lib/qa/authorities/base.rb
qa-5.3.1 lib/qa/authorities/base.rb
qa-5.3.0 lib/qa/authorities/base.rb
qa-5.2.0 lib/qa/authorities/base.rb
qa-5.1.0 lib/qa/authorities/base.rb
qa-5.0.0 lib/qa/authorities/base.rb
qa-4.2.4 lib/qa/authorities/base.rb