Check out example codes for "ruby each do method". It will help you in understanding the concepts better.
Code Example 1
numbers = [1,2,4,9,12]
numbers.each do |n|
break if n > 10
puts n
end
Code Example 2
array.each do |item|
puts "The current array item is: #{item}"
end
Learn ReactJs, React Native from akashmittal.com