module Resync::Client::Mixins::DumpIndex

A resource container whose resources are {ZippedResourceList}s

Public Instance Methods

all_zip_packages() click to toggle source

Downloads and parses each resource list and returns a flattened enumeration of all zip packages in each contained list. Each contained list is only downloaded as needed, and only downloaded once. @return [Enumerator::Lazy<Resync::Client::Zip::ZipPackage>] the flattened enumeration of packages

# File lib/resync/client/mixins/dump_index.rb, line 15
def all_zip_packages
  resources.lazy.flat_map do |r|
    package_for(r)
  end
end

Private Instance Methods

package_for(r) click to toggle source
# File lib/resync/client/mixins/dump_index.rb, line 28
def package_for(r)
  zrl = zipped_resource_list_for(r)
  zrl.respond_to?(:zip_packages) ? zrl.zip_packages : []
end
zipped_resource_list_for(r) click to toggle source
# File lib/resync/client/mixins/dump_index.rb, line 23
def zipped_resource_list_for(r)
  @zipped_resource_lists ||= {}
  @zipped_resource_lists[r] ||= r.get_and_parse
end