Class: TablePal::PlainText

Inherits:
Object
  • Object
show all
Defined in:
lib/plain_text.rb,
lib/plain_text_not_coloured.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table:) ⇒ PlainText

Returns a new instance of PlainText.



6
7
8
9
10
11
12
13
14
15
# File 'lib/plain_text.rb', line 6

def initialize(table:, coloured: false, output: true)
  @table    = table
  @coloured = coloured
  @output   = output
  @result   = ''

  table.rows.each do |row|
    print_row(row)
  end
end

Instance Attribute Details

#colouredObject (readonly)

Returns the value of attribute coloured.



4
5
6
# File 'lib/plain_text.rb', line 4

def coloured
  @coloured
end

#outputObject (readonly)

Returns the value of attribute output.



4
5
6
# File 'lib/plain_text.rb', line 4

def output
  @output
end

#resultObject (readonly)

Returns the value of attribute result.



4
5
6
# File 'lib/plain_text.rb', line 4

def result
  @result
end

#tableObject (readonly)

Returns the value of attribute table.



4
5
6
# File 'lib/plain_text.rb', line 4

def table
  @table
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/plain_text.rb', line 17

def to_s
  result
end