Class: CodeSnippet::Commands::ListSnippets
- Inherits:
-
Object
- Object
- CodeSnippet::Commands::ListSnippets
- Defined in:
- lib/code_snippet/commands/list_snippets.rb
Overview
Lists snippets in STDOUT
Constant Summary collapse
- RESULT_HEADER =
Output table header
%w[NAME LANG].freeze
Instance Method Summary collapse
-
#initialize(manager, options = Hashie::Mash.new) ⇒ ListSnippets
constructor
A new instance of ListSnippets.
-
#run ⇒ Object
Prints a list of snippets to STDOUT.
Constructor Details
#initialize(manager, options = Hashie::Mash.new) ⇒ ListSnippets
Returns a new instance of ListSnippets.
13 14 15 16 17 |
# File 'lib/code_snippet/commands/list_snippets.rb', line 13 def initialize(manager, = Hashie::Mash.new) @manager = manager = @prompt = TTY::Prompt.new end |
Instance Method Details
#run ⇒ Object
Prints a list of snippets to STDOUT
22 23 24 |
# File 'lib/code_snippet/commands/list_snippets.rb', line 22 def run puts(snippet_list_table.render.strip) end |