Iterate over one or more collections. It feels like an .each
implemented as a control structure. It also makes it easier to iterate over multiple objects.
iterate [1,2], [3,4,5] do |e, f|
puts "#{e},#{f}"
end
# 1,3
# 2,4
# ,5
Add to your Gemfile
:
gem 'iterate'
Copyright (C) 2010-2016 Jan Lelis https://janlelis.com. Released under the MIT license.