Class: Datory::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/datory/console.rb

Class Method Summary collapse

Instance Method Summary collapse

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



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



22
23
24
# File 'lib/datory/console.rb', line 22

def print
  puts @text
end