repeatable
repeatable copied to clipboard
Human readable, natural language representation of a Schedule
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 Union
s and Intersection
s.
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.