I have been trying to use the step() method on Date object to retrieve the previous 2 dates from the current date as follows:
date_d.step(2, step=-2){|d|
puts d
}
where 2 is the limit and step is the number of steps backward or forward.
I have done this in accordance with the Documentation given here: Date.step()
This code snippet goes into an infinite loop and then outputs the date non-stop (backwards)
There doesn't seem to be enough documentation for this method and i am not finding solutions online as well.
Please help me out with this.