Skip to content

Instantly share code, notes, and snippets.

@mkeen
Created January 13, 2013 16:15
Show Gist options
  • Select an option

  • Save mkeen/4524882 to your computer and use it in GitHub Desktop.

Select an option

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