Class: Qa::Authorities::LinkedData::GenericAuthority

Inherits:
Base
  • Object
show all
Defined in:
lib/qa/authorities/linked_data/generic_authority.rb

Overview

A wrapper around configured linked data authorities for use with questioning_authority. The search and find methods can be called directly from an instance of this class. The Qa::LinkedDataTermsController uses these methods to provide a URL based API for searching and term retrieval.

Instance Method Summary collapse

Methods inherited from Base

#all, #find

Constructor Details

#initialize(auth_name) ⇒ GenericAuthority

Returns a new instance of GenericAuthority.



22
23
24
25
# File 'lib/qa/authorities/linked_data/generic_authority.rb', line 22

def initialize(auth_name)
  super()
  @authority_config = Qa::Authorities::LinkedData::Config.new(auth_name)
end

Instance Method Details

#authorities_serviceObject



31
32
33
# File 'lib/qa/authorities/linked_data/generic_authority.rb', line 31

def authorities_service
  @authorities_service ||= Qa::LinkedData::AuthorityService
end

#item_serviceObject



39
40
41
# File 'lib/qa/authorities/linked_data/generic_authority.rb', line 39

def item_service
  @item_service ||= Qa::Authorities::LinkedData::FindTerm.new(term_config)
end

#reload_authoritiesObject



27
28
29
# File 'lib/qa/authorities/linked_data/generic_authority.rb', line 27

def reload_authorities
  @authorities_service.load_authorities
end

#search_serviceObject



35
36
37
# File 'lib/qa/authorities/linked_data/generic_authority.rb', line 35

def search_service
  @search_service ||= Qa::Authorities::LinkedData::SearchQuery.new(search_config)
end