Class: StaticSync::StorageCache
- Inherits:
-
Object
- Object
- StaticSync::StorageCache
- Defined in:
- lib/static_sync/storage_cache.rb
Defined Under Namespace
Classes: Version
Instance Method Summary collapse
- #has_conflict?(file) ⇒ Boolean
- #has_file?(file) ⇒ Boolean
- #has_version?(file) ⇒ Boolean
-
#initialize(versions) ⇒ StorageCache
constructor
A new instance of StorageCache.
Constructor Details
#initialize(versions) ⇒ StorageCache
Returns a new instance of StorageCache.
7 8 9 |
# File 'lib/static_sync/storage_cache.rb', line 7 def initialize(versions) @versions = versions end |
Instance Method Details
#has_conflict?(file) ⇒ Boolean
23 24 25 26 27 |
# File 'lib/static_sync/storage_cache.rb', line 23 def has_conflict?(file) @versions.any? do |version| file.path == version.path && file.etag != version.etag end end |
#has_file?(file) ⇒ Boolean
11 12 13 14 15 |
# File 'lib/static_sync/storage_cache.rb', line 11 def has_file?(file) @versions.any? do |version| file.path == version.path end end |
#has_version?(file) ⇒ Boolean
17 18 19 20 21 |
# File 'lib/static_sync/storage_cache.rb', line 17 def has_version?(file) @versions.any? do |version| file.path == version.path && file.etag == version.etag end end |