Class: BruteCLI::BufferOutput::Separator

Inherits:
Object
  • Object
show all
Defined in:
lib/brute_cli/buffer_output/separator.rb

Overview

Renderable horizontal rule for terminal output.

puts BufferOutput::Separator.new(width: 80)
puts BufferOutput::Separator.new(width: 80, thick: true)

Instance Method Summary collapse

Constructor Details

#initialize(width:, thick: false) ⇒ Separator

Returns a new instance of Separator.



13
14
15
16
# File 'lib/brute_cli/buffer_output/separator.rb', line 13

def initialize(width:, thick: false)
  @width = width
  @thick = thick
end

Instance Method Details

#to_sObject



18
19
20
21
# File 'lib/brute_cli/buffer_output/separator.rb', line 18

def to_s
  char = @thick ? "\u2550" : "\u2500"
  (char * [@width, 40].max).colorize(DIM)
end