Class: TablePal::PlainText
- Inherits:
-
Object
- Object
- TablePal::PlainText
- Defined in:
- lib/plain_text.rb,
lib/plain_text_not_coloured.rb
Instance Attribute Summary collapse
-
#coloured ⇒ Object
readonly
Returns the value of attribute coloured.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(table:) ⇒ PlainText
constructor
A new instance of PlainText.
- #to_s ⇒ Object
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
#coloured ⇒ Object (readonly)
Returns the value of attribute coloured.
4 5 6 |
# File 'lib/plain_text.rb', line 4 def coloured @coloured end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/plain_text.rb', line 4 def output @output end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
4 5 6 |
# File 'lib/plain_text.rb', line 4 def result @result end |
#table ⇒ Object (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_s ⇒ Object
17 18 19 |
# File 'lib/plain_text.rb', line 17 def to_s result end |