Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/vps/core_ext/string.rb
Constant Summary collapse
- COLORS =
{ :red => 31, :green => 32, :yellow => 33, :blue => 34, :magenta => 35, :cyan => 36, :white => 39, :gray => 90 }
Instance Method Summary collapse
Instance Method Details
#indent(n, string = " ") ⇒ Object
20 21 22 23 24 |
# File 'lib/vps/core_ext/string.rb', line 20 def indent(n, string = " ") split("\n").collect do |line| line.empty? ? line : "#{string * n}#{line}" end.join("\n") end |