Class: Yobi::FancyHash
- Inherits:
-
Hash
- Object
- Hash
- Yobi::FancyHash
- Defined in:
- lib/yobi/fancy_hash.rb,
sig/yobi.rbs
Overview
Base class for every wrapper around one raw Restic JSON object.
Direct Known Subclasses
BackupError, BackupStatus, BackupSummary, BackupVerboseStatus, CheckError, CheckSummary, DiffChange, DiffStat, DiffStatistics, ExitError, FindMatch, ForgetGroup, Initialized, KeepReason, Key, MatchesPerSnapshot, Node, RepositoryStats, ResticVersion, RestoreStatus, RestoreVerboseStatus, Snapshot, SnapshotSummary, TagChange, TagSummary
Instance Method Summary collapse
-
#initialize(raw) ⇒ FancyHash
constructor
A new instance of FancyHash.
- #inspect ⇒ String
- #pretty_print(q) ⇒ void
Constructor Details
#initialize(raw) ⇒ FancyHash
Returns a new instance of FancyHash.
7 8 9 10 |
# File 'lib/yobi/fancy_hash.rb', line 7 def initialize(raw) super() replace(raw) end |
Instance Method Details
#inspect ⇒ String
13 14 15 |
# File 'lib/yobi/fancy_hash.rb', line 13 def inspect "#<#{self.class} #{super}>" end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/yobi/fancy_hash.rb', line 18 def pretty_print(q) q.object_group(self) do each do |key, value| next if key == "message_type" value = public_send(key) if self.class.method_defined?(key, false) q.breakable q.text "#{key}=" q.pp(value) end end end |