Skip to content

Human readable, natural language representation of a Schedule #4

Description

@molawson

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions