Class: Datory::Console
- Inherits:
-
Object
- Object
- Datory::Console
- Defined in:
- lib/datory/console.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(text) ⇒ Console
constructor
A new instance of Console.
- #print ⇒ Object
Constructor Details
#initialize(text) ⇒ Console
Returns a new instance of Console.
18 19 20 |
# File 'lib/datory/console.rb', line 18 def initialize(text) @text = text end |
Class Method Details
.print_table(headings:, rows:, title: nil) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/datory/console.rb', line 7 def self.print_table(headings:, rows:, title: nil) table = Terminal::Table.new( title:, headings:, rows:, style: { border_x: "~", border_i: "~" } ) new(table.to_s).print end |
Instance Method Details
#print ⇒ Object
22 23 24 |
# File 'lib/datory/console.rb', line 22 def print puts @text end |