Skip to content

Instantly share code, notes, and snippets.

@ilnurnasyrov2
Last active March 22, 2018 09:28
Show Gist options
  • Save ilnurnasyrov2/8971d72b5923eef9099b691b5786f33f to your computer and use it in GitHub Desktop.
Save ilnurnasyrov2/8971d72b5923eef9099b691b5786f33f to your computer and use it in GitHub Desktop.
# example 1 (current)
(1..100).each_slice(10) do |ids|
puts ids.inspect #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
end
# example 2 (suggestion)
(1..100).each_slice(10) do |ids|
puts ids.inspect #=> (1..10)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment