Method: ConsoleTextFormatter.pad
- Defined in:
- lib/console-text-formatter.rb
.pad(str, len) ⇒ Object
print formatter
27 28 29 30 31 |
# File 'lib/console-text-formatter.rb', line 27 def self.pad(str, len) return "".ljust(len) if str.nil? #str = str.slice(0, len) # truncate long strings " "+str.ljust(len-1) # pad with whitespace end |