Class: Yobi::LsOutcome
- Inherits:
-
Object
- Object
- Yobi::LsOutcome
- Defined in:
- lib/yobi/repository/ls.rb,
sig/yobi.rbs
Overview
The outcome of one Repository#ls call.
Instance Attribute Summary collapse
- #output ⇒ Yobi::ResticOutput readonly
Instance Method Summary collapse
-
#initialize(execution) ⇒ LsOutcome
constructor
A new instance of LsOutcome.
- #nodes ⇒ Enumerable<Yobi::Node> (also: #entries)
- #pretty_print(q) ⇒ void
-
#snapshot ⇒ Yobi::Snapshot
The resolved snapshot, useful when
snapshot_id:was"latest".
Constructor Details
#initialize(execution) ⇒ LsOutcome
Returns a new instance of LsOutcome.
64 65 66 |
# File 'lib/yobi/repository/ls.rb', line 64 def initialize(execution) @output = execution[:output] end |
Instance Attribute Details
#output ⇒ Yobi::ResticOutput (readonly)
61 62 63 |
# File 'lib/yobi/repository/ls.rb', line 61 def output @output end |
Instance Method Details
#nodes ⇒ Enumerable<Yobi::Node> Also known as: entries
74 75 76 |
# File 'lib/yobi/repository/ls.rb', line 74 def nodes @nodes ||= output.("node") end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
80 81 82 83 84 85 86 87 |
# File 'lib/yobi/repository/ls.rb', line 80 def pretty_print(q) q.object_group(self) do q.breakable q.pp snapshot q.breakable q.pp nodes end end |
#snapshot ⇒ Yobi::Snapshot
Returns the resolved snapshot, useful when snapshot_id: was "latest".
69 70 71 |
# File 'lib/yobi/repository/ls.rb', line 69 def snapshot @snapshot ||= output.("snapshot").first end |