class CircleCI::CLI::Printer::ProjectPrinter
Attributes
compact[RW]
Public Class Methods
new(projects, pretty: true)
click to toggle source
# File lib/circleci/cli/printer/project_printer.rb, line 9 def initialize(projects, pretty: true) @projects = projects @pretty = pretty end
Public Instance Methods
to_s()
click to toggle source
# File lib/circleci/cli/printer/project_printer.rb, line 14 def to_s @pretty ? print_pretty : print_compact end
Private Instance Methods
print_compact()
click to toggle source
# File lib/circleci/cli/printer/project_printer.rb, line 20 def print_compact @projects .map(&:information) .map { |array| array.join('/').to_s } .sort .join("\n") end
print_pretty()
click to toggle source
# File lib/circleci/cli/printer/project_printer.rb, line 28 def print_pretty Terminal::Table.new( title: Printer.colorize_green('Projects'), headings: ['User name', 'Repository name'], rows: @projects.map(&:information) ).to_s end