Skip to content

Instantly share code, notes, and snippets.

@mkeen
Created January 13, 2013 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkeen/4524882 to your computer and use it in GitHub Desktop.
Save mkeen/4524882 to your computer and use it in GitHub Desktop.
# current behavior
def my_string arg
s = "string"
["stuff", "to", "add"].each do |item|
s << " "
s << item
end
s
end
# i want to write
def my_string arg > s
= "my string"
["stuff", "to", "add"].each do |item|
<< " "
<< item
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment