Skip to content

Instantly share code, notes, and snippets.

@marcdel
Created March 23, 2013 20:21
Show Gist options
  • Save marcdel/5229211 to your computer and use it in GitHub Desktop.
Save marcdel/5229211 to your computer and use it in GitHub Desktop.
[42] pry(main)> (1..5).each { |i| puts i.object_id }
3
5
7
9
11
=> 1..5
[43] pry(main)> (1..5).each { |i| puts (i.object_id - 1) / 2 }
1
2
3
4
5
=> 1..5
[44] pry(main)> (1..5).each { |i| puts (i * 2) + 1 }
3
5
7
9
11
=> 1..5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment