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

Inherits:
Base
  • Object
show all
Includes:
WebServiceBase
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 Attribute Summary collapse

Attributes included from WebServiceBase

#raw_response

Instance Method Summary collapse

Methods included from WebServiceBase

#get_json, #json, #response

Methods inherited from Base

#all, #find, #full_record

Constructor Details

#initialize(auth_name) ⇒ GenericAuthority

Returns a new instance of GenericAuthority.



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

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

Instance Attribute Details

#auth_configObject (readonly)

Returns the value of attribute auth_config.



13
14
15
# File 'lib/qa/authorities/linked_data/generic_authority.rb', line 13

def auth_config
  @auth_config
end

Instance Method Details

#item_serviceObject



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

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

#search_serviceObject



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

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