Class: Qa::Authorities::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/qa/authorities/base.rb

Overview

This class is abstract.

The base class for all authorites. Implementing subclasses must provide #all and ##find methods.

TODO:

What about #search?

Instance Method Summary collapse

Instance Method Details

#allEnumerable

This method is abstract.

By default, #all is not implemented. A subclass authority must implement this method to conform to the generic interface.

TODO:

better specify return type

Returns:

  • (Enumerable)

Raises:

  • (NotImplementedError)

    when this method is abstract.



15
16
17
# File 'lib/qa/authorities/base.rb', line 15

def all
  raise NotImplementedError, "#{self.class}#all is unimplemented."
end

#find(_id) ⇒ Hash

This method is abstract.

By default, #find is not implemented. A subclass authority must implement this method to conform to the generic interface.

TODO:

better specify return type

Parameters:

  • id (String)

    the id string for the authority to lookup

Returns:

  • (Hash)

Raises:

  • (NotImplementedError)

    when this method is abstract.



29
30
31
# File 'lib/qa/authorities/base.rb', line 29

def find(_id)
  raise NotImplementedError, "#{self.class}#find is unimplemented."
end