Class: Envoi::Aspera::WatchService::WatchFolder::Subscription::Snapshot
- Inherits:
-
Object
- Object
- Envoi::Aspera::WatchService::WatchFolder::Subscription::Snapshot
- Defined in:
- lib/envoi/aspera/watch_service/watch_folder.rb
Defined Under Namespace
Classes: Entry
Instance Attribute Summary collapse
-
#entries ⇒ Object
Returns the value of attribute entries.
-
#subscription ⇒ Object
Returns the value of attribute subscription.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #client ⇒ Object
- #differential(from = nil) ⇒ Object
- #differential_no_cache(args = {}) ⇒ Object
- #entries_by_path ⇒ Object
-
#initialize(subscription, version) ⇒ Snapshot
constructor
A new instance of Snapshot.
- #logger ⇒ Object
Constructor Details
#initialize(subscription, version) ⇒ Snapshot
Returns a new instance of Snapshot.
61 62 63 64 65 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 61 def initialize(subscription, version) @subscription = subscription @version = version @entries = nil end |
Instance Attribute Details
#entries ⇒ Object
Returns the value of attribute entries.
59 60 61 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 59 def entries @entries end |
#subscription ⇒ Object
Returns the value of attribute subscription.
59 60 61 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 59 def subscription @subscription end |
#version ⇒ Object
Returns the value of attribute version.
59 60 61 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 59 def version @version end |
Instance Method Details
#client ⇒ Object
67 68 69 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 67 def client subscription.client end |
#differential(from = nil) ⇒ Object
80 81 82 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 80 def differential(from = nil) (@differentials ||= {})[from] ||= differential_no_cache(from: from) end |
#differential_no_cache(args = {}) ⇒ Object
84 85 86 87 88 89 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 84 def differential_no_cache(args = {}) args_out = args.dup args_out[:subscription_id] ||= subscription['identifier'] args_out[:to] ||= version client.subscription_snapshot_differential(args_out) end |
#entries_by_path ⇒ Object
91 92 93 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 91 def entries_by_path @entries_by_hash ||= Hash[entries.map { |e| [e[:path], e] }] end |
#logger ⇒ Object
71 72 73 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 71 def logger client.logger end |