lib/resync/client/mixins/dump.rb in resync-client-0.3.2 vs lib/resync/client/mixins/dump.rb in resync-client-0.3.3

- old
+ new

@@ -24,23 +24,23 @@ # @return [Array<Lazy::Promise<Resync::Client::Zip::ZipPackage>>] the zip packages for each resource def zip_packages @zip_packages ||= resources.map { |r| Lazy.promise { r.zip_package } } end - # Aliases +:zip_packages+ as +:all_zip_packages+ for transparent - # interoperability between +ResourceDump+ and +ResourceDumpIndex+, - # +ChangeDump+ and +ChangeDumpIndex+ - def self.prepended(ext) - ext.send(:alias_method, :all_zip_packages, :zip_packages) - end - end end end class ResourceDump prepend Client::Mixins::Dump + + # Delegates to {#zip_packages} for interoperation with {DumpIndex#all_zip_packages}. + # @return [Enumerator::Lazy<Resync::Resource>] a lazy enumeration of the packages for each + # resource + def all_zip_packages + zip_packages.lazy + end end class ChangeDump include Client::Mixins::Dump @@ -57,8 +57,13 @@ else super() end end - alias_method :all_zip_packages, :zip_packages + # Delegates to {#zip_packages} for interoperation with {ChangeDumpIndex#all_zip_packages}. + # @return [Enumerator::Lazy<Resync::Resource>] a lazy enumeration of the packages for each + # resource + def all_zip_packages(in_range: nil) + zip_packages(in_range: in_range).lazy + end end end