Class: TableBuilder::Column
- Inherits:
-
Object
- Object
- TableBuilder::Column
- Includes:
- ColumnValidator
- Defined in:
- lib/table_builder/column.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text, size) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(text, size) ⇒ Column
Returns a new instance of Column.
8 9 10 11 12 13 14 |
# File 'lib/table_builder/column.rb', line 8 def initialize(text, size) # Ignore ANSI escape sequences pure_text = text.to_pure text += ' ' * (size - pure_text.size) if !size.nil? && size > pure_text.size @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/table_builder/column.rb', line 6 def text @text end |