Class: Yobi::FancyHash
- Inherits:
-
Hash
- Object
- Hash
- Yobi::FancyHash
- Defined in:
- lib/yobi/fancy_hash.rb,
sig/yobi.rbs
Overview
:nodoc:
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 ⇒ Object
- #pretty_print(q) ⇒ Object
Constructor Details
#initialize(raw) ⇒ FancyHash
Returns a new instance of FancyHash.
5 6 7 8 |
# File 'lib/yobi/fancy_hash.rb', line 5 def initialize(raw) super() replace(raw) end |
Instance Method Details
#inspect ⇒ Object
10 11 12 |
# File 'lib/yobi/fancy_hash.rb', line 10 def inspect "#<#{self.class} #{super}>" end |
#pretty_print(q) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/yobi/fancy_hash.rb', line 14 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 |