Class: Vaulty::CLI::Tree
Instance Attribute Summary collapse
-
#catacomb ⇒ Object
readonly
Returns the value of attribute catacomb.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(catacomb:) ⇒ Tree
constructor
A new instance of Tree.
Methods inherited from Command
#banner, call, #prompt, #table
Constructor Details
#initialize(catacomb:) ⇒ Tree
Returns a new instance of Tree.
6 7 8 |
# File 'lib/vaulty/cli/tree.rb', line 6 def initialize(catacomb:) @catacomb = catacomb end |
Instance Attribute Details
#catacomb ⇒ Object (readonly)
Returns the value of attribute catacomb.
4 5 6 |
# File 'lib/vaulty/cli/tree.rb', line 4 def catacomb @catacomb end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/vaulty/cli/tree.rb', line 10 def call spinner = TTY::Spinner.new('Loading :spinner', format: :arrow_pulse, clear: true) spinner.auto_spin vaulty_tree = Vaulty::VaultTree.new(catacomb: catacomb).tree spinner.stop raise Vaulty::EmptyPath, catacomb.path if vaulty_tree.empty? Vaulty::Output::Tree.render(vaulty_tree, prompt: prompt) vaulty_tree end |