Class: Resync::BaseChangeList
- Inherits:
-
SortedResourceList
- Object
- Augmented
- BaseResourceList
- SortedResourceList
- Resync::BaseChangeList
- Defined in:
- lib/resync/shared/base_change_list.rb
Overview
Adds useful methods to ChangeList and ChangeDumpManifest.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from SortedResourceList
Attributes inherited from BaseResourceList
Attributes inherited from Augmented
Instance Method Summary collapse
-
#changes(of_type: nil, in_range: nil) ⇒ Array<Resource>
Filters the list of changes by change type, modification time, or both.
Methods inherited from SortedResourceList
#all_uris, #latest_for, #resources=
Methods inherited from BaseResourceList
#capability, inherited, #initialize, #metadata=, #pre_save, #resource_for, #resources_for, #resources_in
Methods inherited from Augmented
#at_time, #change, #completed_time, #from_time, #initialize, #link_for, #links_for, #until_time
Constructor Details
This class inherits a constructor from Resync::BaseResourceList
Instance Method Details
#changes(of_type: nil, in_range: nil) ⇒ Array<Resource>
Filters the list of changes by change type, modification time, or both.
11 12 13 14 15 16 17 |
# File 'lib/resync/shared/base_change_list.rb', line 11 def changes(of_type: nil, in_range: nil) resources.select do |r| is_of_type = of_type ? r.change == of_type : true is_in_range = in_range ? in_range.cover?(r.modified_time) : true is_of_type && is_in_range end end |