Module: Resync::Client::Mixins::ListIndex
- Includes:
- ResourceClientDelegate
- Included in:
- Resync::ChangeListIndex, ResourceListIndex
- Defined in:
- lib/resync/client/mixins/list_index.rb
Overview
A resource container whose resources are, themselves, resource containers
Instance Attribute Summary
Attributes included from ClientDelegator
Instance Method Summary collapse
-
#all_resources ⇒ Enumerator::Lazy<Resync::Resource>
Downloads and parses each resource list and returns a flattened enumeration of all resources in each contained list.
Methods included from ResourceClientDelegate
Methods included from ClientDelegator
Instance Method Details
#all_resources ⇒ Enumerator::Lazy<Resync::Resource>
Downloads and parses each resource list and returns a flattened enumeration of all resources in each contained list. Each contained list is only downloaded as needed, and only downloaded once.
15 16 17 18 19 20 21 |
# File 'lib/resync/client/mixins/list_index.rb', line 15 def all_resources @resource_lists ||= {} resources.lazy.flat_map do |r| @resource_lists[r] ||= r.get_and_parse @resource_lists[r].resources end end |