Class: Circler::ProjectPrinter
- Inherits:
-
Object
- Object
- Circler::ProjectPrinter
- Defined in:
- lib/circler/printer/project_printer.rb
Instance Attribute Summary collapse
-
#compact ⇒ Object
Returns the value of attribute compact.
Instance Method Summary collapse
-
#initialize(projects, compact: false) ⇒ ProjectPrinter
constructor
A new instance of ProjectPrinter.
- #to_s ⇒ Object
Constructor Details
#initialize(projects, compact: false) ⇒ ProjectPrinter
Returns a new instance of ProjectPrinter.
4 5 6 7 |
# File 'lib/circler/printer/project_printer.rb', line 4 def initialize(projects, compact: false) @projects = projects @compact = compact end |
Instance Attribute Details
#compact ⇒ Object
Returns the value of attribute compact.
3 4 5 |
# File 'lib/circler/printer/project_printer.rb', line 3 def compact @compact end |
Instance Method Details
#to_s ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/circler/printer/project_printer.rb', line 9 def to_s if compact @projects.map(&:name_array) else Terminal::Table.new( title: 'Projects'.green, headings: ['User name', 'Repository name'], rows: @projects.map(&:information) ).to_s end end |