Class: BruteCLI::BufferOutput::Separator
- Inherits:
-
Object
- Object
- BruteCLI::BufferOutput::Separator
- 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
-
#initialize(width:, thick: false) ⇒ Separator
constructor
A new instance of Separator.
- #to_s ⇒ Object
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_s ⇒ Object
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 |