Module: Yobi::BackupMessageWrapper
- Defined in:
- lib/yobi/repository/backup.rb,
sig/yobi.rbs
Overview
Classifies a raw backup message Hash by its own message_type, wrapping
it in the matching typed class. Used both by Repository#backup
(as the ResticOutput transform: for a live streaming run) and
by BackupOutcome's own post-hoc accessors.
Class Method Summary collapse
-
.call(raw) ⇒ Yobi::BackupStatus, ...
The raw Hash itself for a message_type this version of Yobi doesn't recognize.
Class Method Details
.call(raw) ⇒ Yobi::BackupStatus, ...
Returns the raw Hash itself for a message_type this version of Yobi doesn't recognize.
120 121 122 123 124 125 126 127 128 |
# File 'lib/yobi/repository/backup.rb', line 120 def self.call(raw) case raw["message_type"] when "status" then BackupStatus.new(raw) when "error" then BackupError.new(raw) when "verbose_status" then BackupVerboseStatus.new(raw) when "summary" then BackupSummary.new(raw) else raw end end |