method

step

v2_5_5 - Show latest stable - Class: Date
step(p1, p2 = v2)
public

Iterates evaluation of the given block, which takes a date object. The limit should be a date object.

Date.new(2001).step(Date.new(2001,-1,-1)).select{|d| d.sunday?}.size
                          #=> 52