Module: Qa::Authorities::AssignFastSubauthority

Included in:
AssignFast
Defined in:
lib/qa/authorities/assign_fast_subauthority.rb

Overview

Encapsulate information about assignFAST subauthorities

Constant Summary collapse

SUBAUTHORITIES =

Hash of subauthority names used in qa routes => ‘index’ used by API

{
  'all'        => 'suggestall',
  'personal'   => 'suggest00',
  'corporate'  => 'suggest10',
  'event'      => 'suggest11',
  'uniform'    => 'suggest30',
  'topical'    => 'suggest50',
  'geographic' => 'suggest51',
  'form_genre' => 'suggest55'
}.freeze

Instance Method Summary collapse

Instance Method Details

#index_for_authority(authority) ⇒ String

Get an API index name from an English name

Parameters:

  • English (String)

    name

Returns:

  • (String)

    index name



26
27
28
# File 'lib/qa/authorities/assign_fast_subauthority.rb', line 26

def index_for_authority(authority)
  SUBAUTHORITIES[authority]
end

#subauthoritiesArray<String>

Get a list of subauthorities by name

Returns:

  • (Array<String>)


18
19
20
# File 'lib/qa/authorities/assign_fast_subauthority.rb', line 18

def subauthorities
  SUBAUTHORITIES.keys
end