Sha256: e01c15a8372da6eeca28dfa7427f6c2fc8e8acb5e09553e55b9a91b22821489a

Contents?: true

Size: 1.26 KB

Versions: 10

Compression:

Stored size: 1.26 KB

Contents

require 'deprecation'

module Qa::Authorities
  ##
  # @abstract The base class for all authorites. Implementing subclasses must
  #   provide {#all} and #{find} methods.
  # @todo What about {#search}?
  class Base
    extend Deprecation

    ##
    # @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

    ##
    # @deprecated use {#find} instead
    def full_record(id, _subauthority = nil)
      Deprecation.warn('#full_record is deprecated. Use #find instead')
      find(id)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
qa-3.1.0 lib/qa/authorities/base.rb
qa-2.3.0 lib/qa/authorities/base.rb
qa-3.0.0 lib/qa/authorities/base.rb
qa-2.2.0 lib/qa/authorities/base.rb
qa-2.1.2 lib/qa/authorities/base.rb
qa-2.1.1 lib/qa/authorities/base.rb
qa-2.0.1 lib/qa/authorities/base.rb
qa-2.0.0 lib/qa/authorities/base.rb
qa-1.2.0 lib/qa/authorities/base.rb
qa-1.1.0 lib/qa/authorities/base.rb