Skip to content

Instantly share code, notes, and snippets.

@adamcooper
Created April 4, 2013 23:23
Show Gist options
  • Save adamcooper/5315262 to your computer and use it in GitHub Desktop.
Save adamcooper/5315262 to your computer and use it in GitHub Desktop.
Don't use "and" in ruby.
>> [1,2,3, 4].each {|x| puts x; break if x == 1}
1
=> nil
>> [1,2,3, 4].each {|x| puts x; puts 'broken' and break if x == 1}
1
broken
2
3
4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment