Class: String

Inherits:
Object show all
Defined in:
lib/open_classes/string.rb

Overview

String

Instance Method Summary collapse

Instance Method Details

#justify_tableObject

Justify pipe using table format

before justify

|* first name|* family name|
|eiichiro|oda|
|akira|toriyama|
|yusei|matsui|

after justify

|* first name|* family name|
|eiichiro    |oda          |
|akira       |toriyama     |
|yusei       |matsui       |


20
21
22
23
24
25
# File 'lib/open_classes/string.rb', line 20

def justify_table
  return self if self.empty?
  max_sizes = get_column_maxes
  return self if max_sizes.nil?
  justify_lines max_sizes
end