class Qa::LinkedData::AuthorityService
Public Class Methods
Source
# File lib/qa/linked_data/authority_service.rb, line 25 def self.load_assign_fast_config assign_fast_auth_cfg = {} # assign_fast settings Dir[File.join(Qa::Engine.root, 'config', 'authorities', 'assign_fast', '*.json')].each do |fn| process_config_file(file_path: fn, config_hash: assign_fast_auth_cfg) end # Optional local (app) assign_fast settings overrides Dir[Rails.root.join('config', 'authorities', 'assign_fast', '*.json')].each do |fn| process_config_file(file_path: fn, config_hash: assign_fast_auth_cfg) end Qa.config.assign_fast_authority_configs = assign_fast_auth_cfg end
similar to the above; these settings are for getting (non-linked-data) FAST subject headings from OCLC.
Source
# File lib/qa/linked_data/authority_service.rb, line 11 def self.load_linked_data_config ld_auth_cfg = {} # Linked data settings Dir[File.join(Qa::Engine.root, 'config', 'authorities', 'linked_data', '*.json')].each do |fn| process_config_file(file_path: fn, config_hash: ld_auth_cfg) end # Optional local (app) linked data settings overrides Dir[Rails.root.join('config', 'authorities', 'linked_data', '*.json')].each do |fn| process_config_file(file_path: fn, config_hash: ld_auth_cfg) end Qa.config.linked_data_authority_configs = ld_auth_cfg end
Load or reload the linked data configuration files
Source
# File lib/qa/linked_data/authority_service.rb, line 39 def self.process_config_file(file_path:, config_hash:) file_key = File.basename(file_path, '.json').upcase.to_sym json = File.read(File.expand_path(file_path, __FILE__)) cfg = JSON.parse(json).deep_symbolize_keys config_hash[file_key] = cfg end
load settings into a configuration hash: