class Samovar::Output::UsageFormatter
Public Class Methods
new(rows, output)
click to toggle source
# File lib/samovar/output/usage_formatter.rb, line 27 def initialize(rows, output) @rows = rows @output = output @width = 80 @terminal = Console::Terminal.for(@output) @terminal[:header] = @terminal.style(nil, nil, :bright) @terminal[:description] = @terminal.style(:blue) @terminal[:error] = @terminal.style(:red) end
print(rows, output) { |formatter| ... }
click to toggle source
# File lib/samovar/output/usage_formatter.rb, line 19 def self.print(rows, output) formatter = self.new(rows, output) yield formatter if block_given? formatter.print end
Public Instance Methods
print()
click to toggle source
# File lib/samovar/output/usage_formatter.rb, line 67 def print map(@rows) end