repeatable icon indicating copy to clipboard operation
repeatable copied to clipboard

Human readable, natural language representation of a Schedule

Open molawson opened this issue 9 years ago • 0 comments

It would be handy to have Schedule#to_s return a text description of the Schedule.

schedule = Repeatable::Schedule.new(weekday_in_month: { weekday: 2, count: 1 })
schedule.to_s # => "The first Tuesday of every month"

Obviously, that's a straightforward case and things get more difficult with Unions and Intersections.

The first step would probably involve coming up with how you'd naturally describe more complex expressions and then devise a plan for a #to_s for each Expression type.

molawson avatar Mar 09 '15 14:03 molawson