Class: CDMBL::Extractor
- Inherits:
-
Object
- Object
- CDMBL::Extractor
- Extended by:
- Forwardable
- Defined in:
- lib/cdmbl/extractor.rb
Overview
This extractor uses the SimpleGet extractor initially and then makes subsequent passes at the full ContentDM API with identifiers taken from the contentdm api
Instance Attribute Summary collapse
-
#cdm_endpoint ⇒ Object
readonly
Returns the value of attribute cdm_endpoint.
-
#cdm_item ⇒ Object
readonly
Returns the value of attribute cdm_item.
-
#oai_filter ⇒ Object
readonly
Returns the value of attribute oai_filter.
-
#oai_request ⇒ Object
readonly
Returns the value of attribute oai_request.
-
#oai_set_lookup ⇒ Object
readonly
Returns the value of attribute oai_set_lookup.
Instance Method Summary collapse
-
#cdm_request(collection, id) ⇒ Object
e.g.
- #deletable_ids ⇒ Object
-
#initialize(oai_request: OaiRequest.new, cdm_endpoint: '', oai_set_lookup: OAISetLookup, cdm_item: CONTENTdmAPI::Item, oai_filter: OAIFilter) ⇒ Extractor
constructor
A new instance of Extractor.
- #local_identifiers ⇒ Object
- #next_resumption_token ⇒ Object
- #set_lookup ⇒ Object
Constructor Details
#initialize(oai_request: OaiRequest.new, cdm_endpoint: '', oai_set_lookup: OAISetLookup, cdm_item: CONTENTdmAPI::Item, oai_filter: OAIFilter) ⇒ Extractor
Returns a new instance of Extractor.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cdmbl/extractor.rb', line 19 def initialize(oai_request: OaiRequest.new, cdm_endpoint: '', oai_set_lookup: OAISetLookup, cdm_item: CONTENTdmAPI::Item, oai_filter: OAIFilter) @oai_request = oai_request @cdm_item = cdm_item @cdm_endpoint = cdm_endpoint @oai_set_lookup = oai_set_lookup @oai_filter = oai_filter end |
Instance Attribute Details
#cdm_endpoint ⇒ Object (readonly)
Returns the value of attribute cdm_endpoint.
13 14 15 |
# File 'lib/cdmbl/extractor.rb', line 13 def cdm_endpoint @cdm_endpoint end |
#cdm_item ⇒ Object (readonly)
Returns the value of attribute cdm_item.
13 14 15 |
# File 'lib/cdmbl/extractor.rb', line 13 def cdm_item @cdm_item end |
#oai_filter ⇒ Object (readonly)
Returns the value of attribute oai_filter.
13 14 15 |
# File 'lib/cdmbl/extractor.rb', line 13 def oai_filter @oai_filter end |
#oai_request ⇒ Object (readonly)
Returns the value of attribute oai_request.
13 14 15 |
# File 'lib/cdmbl/extractor.rb', line 13 def oai_request @oai_request end |
#oai_set_lookup ⇒ Object (readonly)
Returns the value of attribute oai_set_lookup.
13 14 15 |
# File 'lib/cdmbl/extractor.rb', line 13 def oai_set_lookup @oai_set_lookup end |
Instance Method Details
#cdm_request(collection, id) ⇒ Object
e.g. local_identifiers.map { |identifier| extractor.cdm_request(*identifier) }
48 49 50 51 |
# File 'lib/cdmbl/extractor.rb', line 48 def cdm_request(collection, id) CDMBL::CdmNotification.call!(collection, id, cdm_endpoint) cdm_item.new(base_url: cdm_endpoint, collection: collection, id: id). end |
#deletable_ids ⇒ Object
35 36 37 |
# File 'lib/cdmbl/extractor.rb', line 35 def deletable_ids oai_ids.deletable_ids end |
#local_identifiers ⇒ Object
39 40 41 |
# File 'lib/cdmbl/extractor.rb', line 39 def local_identifiers oai_ids.updatable_ids end |
#next_resumption_token ⇒ Object
43 44 45 |
# File 'lib/cdmbl/extractor.rb', line 43 def next_resumption_token oai_identifiers.at_path('OAI_PMH/ListIdentifiers/resumptionToken') end |
#set_lookup ⇒ Object
31 32 33 |
# File 'lib/cdmbl/extractor.rb', line 31 def set_lookup oai_set_lookup.new(oai_sets: to_hash(sets)).keyed end |