Class: Qa::Authorities::Local

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

authority_valid?

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



6
7
8
# File 'lib/qa/authorities/local.rb', line 6

def results
  @results
end

Class Method Details

.sub_authoritiesObject



15
16
17
# File 'lib/qa/authorities/local.rb', line 15

def sub_authorities
  Subauthority.names
end

.sub_authority(name) ⇒ Object

Raises:

  • (ArgumentError)


9
10
11
12
13
# File 'lib/qa/authorities/local.rb', line 9

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



19
20
21
# File 'lib/qa/authorities/local.rb', line 19

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

Instance Method Details

#full_record(id, sub_authority) ⇒ Object



30
31
32
# File 'lib/qa/authorities/local.rb', line 30

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

#get_full_record(id, sub_authority) ⇒ Object



34
35
36
37
# File 'lib/qa/authorities/local.rb', line 34

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



26
27
28
# File 'lib/qa/authorities/local.rb', line 26

def search(q, sub_authority)
  @results = sub_authority(sub_authority).search(q)
end