Class: Qa::Authorities::LinkedData::AuthorityService
- Inherits:
-
Object
- Object
- Qa::Authorities::LinkedData::AuthorityService
- Defined in:
- lib/qa/authorities/linked_data/authority_service.rb
Class Method Summary collapse
-
.authority_config(authname) ⇒ Array<String>
Get the configuration for an authority.
-
.authority_configs ⇒ Array<String>
Get the list of names of the loaded authorities.
-
.authority_names ⇒ Array<String>
Get the list of names of the loaded authorities.
-
.load_authorities ⇒ Object
Load or reload the linked data configuration files.
Class Method Details
.authority_config(authname) ⇒ Array<String>
Get the configuration for an authority
36 37 38 |
# File 'lib/qa/authorities/linked_data/authority_service.rb', line 36 def self.(authname) [authname] end |
.authority_configs ⇒ Array<String>
Get the list of names of the loaded authorities
29 30 31 |
# File 'lib/qa/authorities/linked_data/authority_service.rb', line 29 def self. Qa.config. end |
.authority_names ⇒ Array<String>
Get the list of names of the loaded authorities
42 43 44 |
# File 'lib/qa/authorities/linked_data/authority_service.rb', line 42 def self. .keys.sort end |
.load_authorities ⇒ Object
Load or reload the linked data configuration files
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/qa/authorities/linked_data/authority_service.rb', line 7 def self. auth_cfg = {} # load QA configured linked data authorities Dir[File.join(Qa::Engine.root, 'config', 'authorities', 'linked_data', '*.json')].each do |fn| auth = File.basename(fn, '.json').upcase.to_sym json = File.read(File.(fn, __FILE__)) cfg = JSON.parse(json).deep_symbolize_keys auth_cfg[auth] = cfg end # load app configured linked data authorities and overrides Dir[Rails.root.join('config', 'authorities', 'linked_data', '*.json')].each do |fn| auth = File.basename(fn, '.json').upcase.to_sym json = File.read(File.(fn, __FILE__)) cfg = JSON.parse(json).deep_symbolize_keys auth_cfg[auth] = cfg end Qa.config. = auth_cfg end |