Method: ANSIColor#uncolored
- Defined in:
- lib/mega/ansicolor.rb
#uncolored(string = nil) ⇒ Object
142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/mega/ansicolor.rb', line 142 def uncolored(string = nil) if block_given? yield.gsub(ColoredRegexp, '') elsif string string.gsub(ColoredRegexp, '') elsif respond_to?(:to_str) gsub(ColoredRegexp, '') else '' end end |