Skip to content

Instantly share code, notes, and snippets.

@kenzie
Created August 16, 2011 12:49
Show Gist options
  • Save kenzie/1148995 to your computer and use it in GitHub Desktop.
Save kenzie/1148995 to your computer and use it in GitHub Desktop.
Add an indent method to String.
class String
# adds tabs to the beginning of each line
def indent(tabs=4)
self.gsub(/^/, "\t"*tabs)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment