Class: Envoi::Aspera::WatchService::WatchFolder::Subscription::Snapshot::Entry
- Inherits:
-
Hash
- Object
- Hash
- Envoi::Aspera::WatchService::WatchFolder::Subscription::Snapshot::Entry
- Defined in:
- lib/envoi/aspera/watch_service/watch_folder.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Entry
constructor
A new instance of Entry.
- #path ⇒ Object
- #stat ⇒ Object
- #stat_as_json ⇒ Object
Constructor Details
#initialize(data) ⇒ Entry
Returns a new instance of Entry.
30 31 32 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 30 def initialize(data) merge! data end |
Class Method Details
.new_from_match_data(match_data) ⇒ Object
47 48 49 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 47 def self.new_from_match_data(match_data) new(match_data.named_captures) end |
Instance Method Details
#path ⇒ Object
34 35 36 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 34 def path; self[:path] end |
#stat ⇒ Object
38 39 40 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 38 def stat; self[:stat] ||= ((json = self[:stat_as_json]) ? JSON.parse(json) : nil) end |
#stat_as_json ⇒ Object
42 43 44 |
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 42 def stat_as_json; self[:stat_as_json] end |