Class: Qa::Authorities::Local

Inherits:
Base
  • Object
show all
Extended by:
Deprecation
Defined in:
lib/qa/authorities/local.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

authority_valid?

Class Method Details

.sub_authoritiesObject



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

def sub_authorities
  Subauthority.names
end

.sub_authority(name) ⇒ Object

Raises:

  • (ArgumentError)


7
8
9
10
11
# File 'lib/qa/authorities/local.rb', line 7

def sub_authority(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



17
18
19
# File 'lib/qa/authorities/local.rb', line 17

def terms(sub_authority)
  sub_authority(sub_authority).terms
end

Instance Method Details

#full_record(id, sub_authority) ⇒ Object



28
29
30
# File 'lib/qa/authorities/local.rb', line 28

def full_record(id, sub_authority)
  sub_authority(sub_authority).full_record(id)
end

#get_full_record(id, sub_authority) ⇒ Object



32
33
34
35
# File 'lib/qa/authorities/local.rb', line 32

def get_full_record(id, sub_authority)
  Deprecation.warn(Local, "get_full_record is deprecated and will be removed in 0.1.0. Use full_record instead", caller)
  full_record(id, sub_authority)
end

#search(q, sub_authority) ⇒ Object



24
25
26
# File 'lib/qa/authorities/local.rb', line 24

def search(q, sub_authority)
  sub_authority(sub_authority).search(q)
end