Class: Qa::Authorities::Oclcts::GenericOclcAuthority
- Includes:
- WebServiceBase
- Defined in:
- lib/qa/authorities/oclcts/generic_oclc_authority.rb
Instance Attribute Summary collapse
-
#subauthority ⇒ Object
readonly
Returns the value of attribute subauthority.
Attributes included from WebServiceBase
Instance Method Summary collapse
- #find(id) ⇒ Object
-
#initialize(subauthority) ⇒ GenericOclcAuthority
constructor
A new instance of GenericOclcAuthority.
- #search(q) ⇒ Object
Methods included from WebServiceBase
Methods inherited from Base
Constructor Details
#initialize(subauthority) ⇒ GenericOclcAuthority
Returns a new instance of GenericOclcAuthority.
5 6 7 |
# File 'lib/qa/authorities/oclcts/generic_oclc_authority.rb', line 5 def initialize() @subauthority = end |
Instance Attribute Details
#subauthority ⇒ Object (readonly)
Returns the value of attribute subauthority.
3 4 5 |
# File 'lib/qa/authorities/oclcts/generic_oclc_authority.rb', line 3 def @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 |