Class: Yobi::LsOutcome
- Inherits:
-
Object
- Object
- Yobi::LsOutcome
- Defined in:
- lib/yobi/repository/ls.rb,
sig/yobi.rbs
Overview
The outcome of one Yobi::Repository#ls call.
Instance Attribute Summary collapse
-
#output ⇒ ResticOutput
readonly
The Yobi::ResticOutput backing this outcome.
Instance Method Summary collapse
-
#initialize(execution) ⇒ LsOutcome
constructor
:nodoc:.
-
#nodes ⇒ ResticOutput::LazyList[Node]
(also: #entries)
Every Yobi::Node from the run.
- #pretty_print(q) ⇒ Object
-
#snapshot ⇒ Snapshot
The resolved Yobi::Snapshot, useful when
snapshot_id:was"latest".
Constructor Details
#initialize(execution) ⇒ LsOutcome
:nodoc:
53 54 55 |
# File 'lib/yobi/repository/ls.rb', line 53 def initialize(execution) # :nodoc: @output = execution[:output] end |
Instance Attribute Details
#output ⇒ ResticOutput (readonly)
The Yobi::ResticOutput backing this outcome.
51 52 53 |
# File 'lib/yobi/repository/ls.rb', line 51 def output @output end |
Instance Method Details
#nodes ⇒ ResticOutput::LazyList[Node] Also known as: entries
Every Yobi::Node from the run.
63 64 65 |
# File 'lib/yobi/repository/ls.rb', line 63 def nodes @nodes ||= output.("node") end |
#pretty_print(q) ⇒ Object
68 69 70 71 72 73 74 75 |
# File 'lib/yobi/repository/ls.rb', line 68 def pretty_print(q) q.object_group(self) do q.breakable q.pp snapshot q.breakable q.pp nodes end end |
#snapshot ⇒ Snapshot
The resolved Yobi::Snapshot, useful when snapshot_id: was "latest".
58 59 60 |
# File 'lib/yobi/repository/ls.rb', line 58 def snapshot @snapshot ||= output.("snapshot").first end |