Class: Envoi::Aspera::WatchService::WatchFolder::Subscription::Snapshot::Entry

Inherits:
Hash
  • Object
show all
Defined in:
lib/envoi/aspera/watch_service/watch_folder.rb

Class Method Summary collapse

Instance Method Summary collapse

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

#pathObject



34
35
36
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 34

def path;
  self[:path]
end

#statObject



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_jsonObject



42
43
44
# File 'lib/envoi/aspera/watch_service/watch_folder.rb', line 42

def stat_as_json;
  self[:stat_as_json]
end