SyntaxFix
Write A Post
Hire A Developer
Questions
You can use Numeric#step.
Numeric#step
0.step(30,5) do |num| puts "number is #{num}" end # >> number is 0 # >> number is 5 # >> number is 10 # >> number is 15 # >> number is 20 # >> number is 25 # >> number is 30