Class: RubyCode::Views::Formatter::MinimalToolInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycode/views/formatter/minimal_tool_info.rb

Overview

Builds minimal tool info table display

Class Method Summary collapse

Class Method Details

.build(label:, value:) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rubycode/views/formatter/minimal_tool_info.rb', line 11

def self.build(label:, value:)
  pastel = Pastel.new

  table = TTY::Table.new(rows: [
                           [
                             pastel.cyan(label),
                             value
                           ]
                         ])

  "  #{table.render(:basic, padding: [0, 1])}"
end