class String

Public Instance Methods

unindent() click to toggle source

Strip leading whitespace from each line that is the same as the amount of whitespace on the first line of the string. Leaves additional indentation on later lines intact.

# File lib/manic_monkey/string_patches.rb, line 5
def unindent
  gsub /^#{self[/\A\s*/]}/, ''
end