Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Human readable, natural language representation of a Schedule #4

Open
molawson opened this issue Mar 9, 2015 · 0 comments
Open

Human readable, natural language representation of a Schedule #4

molawson opened this issue Mar 9, 2015 · 0 comments

Comments

@molawson
Copy link
Owner

molawson commented Mar 9, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant