Sha256: e16a51aea45b862035ef15cc3cd1f87ccd9e1e7a3972b8a0c0071de146302ca5

Contents?: true

Size: 712 Bytes

Versions: 1

Compression:

Stored size: 712 Bytes

Contents

class PurlFetcher::Client::DeletesReader < PurlFetcher::Client::Reader
  # Enumerate objects that should be deleted.
  def each
    return to_enum(:each) unless block_given?

    deletes(first_modified: first_modified).each do |change|
      yield PurlFetcher::Client::PublicXmlRecord.new(change['druid'].sub('druid:', ''), settings)
    end

    changes(first_modified: first_modified, target: target).each do |change|
      record = PurlFetcher::Client::PublicXmlRecord.new(change['druid'].sub('druid:', ''), settings)

      next unless target.nil? || (change['false_targets'] && change['false_targets'].include?(target)) || (settings['skip_if_catkey'] && record.catkey)

      yield record
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
purl_fetcher-client-0.2.0 lib/purl_fetcher/client/deletes_reader.rb