class String
Public Instance Methods
Source
# File lib/ra10ke/monkey_patches.rb, line 5 def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end
colorization
Source
# File lib/ra10ke/monkey_patches.rb, line 23 def strip_comment(markers = ['#', "\n"]) re = Regexp.union(markers) index = (self =~ re) index.nil? ? rstrip : self[0, index].rstrip end
removes specified markes from string. @return [String] - the string with markers removed