Summary

Simple Ruby method to unindent strings. Useful for multiline strings embeded in already indented code.

Examples

class Profile

def default_text
  <<-STR.unindent
    Anonymous Coward
      - Community Guest
  STR
end

end

puts Profile.new.default_text

will output: Anonymous Coward

- Community Guest

instead of:

Anonymous Coward
  - Community Guest