Class: Qa::Authorities::Oclcts::GenericOclcAuthority
- Inherits:
-
Base
- Object
- Base
- Qa::Authorities::Oclcts::GenericOclcAuthority
show all
- Includes:
- WebServiceBase
- Defined in:
- lib/qa/authorities/oclcts/generic_oclc_authority.rb
Instance Attribute Summary collapse
#raw_response
Instance Method Summary
collapse
#get_json, #json, #response
Methods inherited from Base
#all, #full_record
Constructor Details
5
6
7
|
# File 'lib/qa/authorities/oclcts/generic_oclc_authority.rb', line 5
def initialize(subauthority)
@subauthority = subauthority
end
|
Instance Attribute Details
#subauthority ⇒ Object
Returns the value of attribute subauthority.
3
4
5
|
# File 'lib/qa/authorities/oclcts/generic_oclc_authority.rb', line 3
def subauthority
@subauthority
end
|
Instance Method Details
#find(id) ⇒ Object
19
20
21
22
|
# File 'lib/qa/authorities/oclcts/generic_oclc_authority.rb', line 19
def find(id)
get_raw_response("id-lookup", id)
parse_full_record(id)
end
|
#search(q) ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'lib/qa/authorities/oclcts/generic_oclc_authority.rb', line 10
def search(q)
get_raw_response("prefix-query", q)
r = []
raw_response.xpath('sru:searchRetrieveResponse/sru:records/sru:record/sru:recordData', 'sru' => 'http://www.loc.gov/zing/srw/').each do |record|
r.append("id" => record.xpath('Zthes/term/termId').first.content, "label" => record.xpath('Zthes/term/termName').first.content)
end
r
end
|