Class: Qa::Authorities::Local
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Class Method Details
.sub_authorities ⇒ Object
12 13 14 |
# File 'lib/qa/authorities/local.rb', line 12 def Subauthority.names end |
.sub_authority(name) ⇒ Object
6 7 8 9 10 |
# File 'lib/qa/authorities/local.rb', line 6 def (name) @sub_authorities ||= {} raise ArgumentError, "Invalid sub-authority '#{name}'" unless Subauthority.names.include?(name) @sub_authorities[name] ||= Subauthority.new(name) end |
.terms(sub_authority) ⇒ Object
16 17 18 |
# File 'lib/qa/authorities/local.rb', line 16 def terms() ().terms end |
Instance Method Details
#get_full_record(id, sub_authority) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/qa/authorities/local.rb', line 25 def get_full_record(id, ) terms = Local.().terms terms.each do |term| return term if term[:id] == id end return {} end |
#search(q, sub_authority) ⇒ Object
21 22 23 |
# File 'lib/qa/authorities/local.rb', line 21 def search(q, ) Local.().search(q) end |