Class: Timeprice::CLI::Presenters::Sources
- Inherits:
-
Object
- Object
- Timeprice::CLI::Presenters::Sources
- Defined in:
- lib/timeprice/cli/presenters/sources.rb
Overview
Renders the sources list in compact-table, verbose, and JSON formats.
Constant Summary collapse
- MAX_SOURCE_NAME =
60
Instance Method Summary collapse
-
#initialize(list, verbose: false) ⇒ Sources
constructor
A new instance of Sources.
- #json_hash ⇒ Object
- #text_lines ⇒ Object
Constructor Details
#initialize(list, verbose: false) ⇒ Sources
Returns a new instance of Sources.
10 11 12 13 |
# File 'lib/timeprice/cli/presenters/sources.rb', line 10 def initialize(list, verbose: false) @list = list @verbose = verbose end |
Instance Method Details
#json_hash ⇒ Object
15 16 17 |
# File 'lib/timeprice/cli/presenters/sources.rb', line 15 def json_hash @list end |
#text_lines ⇒ Object
19 20 21 |
# File 'lib/timeprice/cli/presenters/sources.rb', line 19 def text_lines @verbose ? verbose_lines : table_lines end |