Class: Shellout::Shadowbox
- Inherits:
-
Object
- Object
- Shellout::Shadowbox
- Defined in:
- lib/shellout/shadowbox.rb
Constant Summary collapse
- MIN_WIDTH =
40
Instance Method Summary collapse
-
#initialize(title) ⇒ Shadowbox
constructor
A new instance of Shadowbox.
- #print(out = $stdout) ⇒ Object
Constructor Details
#initialize(title) ⇒ Shadowbox
Returns a new instance of Shadowbox.
8 9 10 |
# File 'lib/shellout/shadowbox.rb', line 8 def initialize(title) @title = title end |
Instance Method Details
#print(out = $stdout) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/shellout/shadowbox.rb', line 12 def print(out=$stdout) length = [@title.length, MIN_WIDTH].max + 2 out.print "" << '┌' << '─' * length << "┐ \n" << '│ ' << @title.center(MIN_WIDTH) << " │▒\n" << '└' << '─' * length << "┘▒\n" << ' ' << '▒' * length << "▒\n" end |