class String
add a few methods for manipulating text
Public Instance Methods
indent(double_space_count = 1)
click to toggle source
# File lib/string.rb 29 def indent(double_space_count = 1) 30 double_space_count.times { insert(0, ' ') } 31 self 32 end
to_green()
click to toggle source
# File lib/string.rb 21 def to_green 22 "\033[32m#{self}\033[0m" 23 end
to_red()
click to toggle source
# File lib/string.rb 25 def to_red 26 "\033[31m#{self}\033[0m" 27 end