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

Make 'er quack like an Icalendar Component! #23

Merged
merged 3 commits into from
Oct 29, 2023

Conversation

jon-sully
Copy link
Contributor

In the Icalendar gem there is a Component class that many other classes inherit from, including Calendar and Event. The Component specifies a :parent attribute that is available on all of its inheritors. This is useful throughout the usage of the Icalendar gem since you can pass around a single object and still have access to most of the object tree if you need it. Occurrence does not follow that pattern, requiring that any app passing around occurrences (either as an individual or an object) must also accompany that occurrence with the associated event if it wants any context. I don't think it's necessary to go so far as to make Occurrence inherit from Component, as I want to be wary of too much overhead on an otherwise very simple class / struct, but I think Occurrence could at least implement the :parent method since that information is readily available at the time the Occurrences are instantiated in Schedule.

This PR adds and populates the :parent method on the Occurrence object with a very simplistic change and adds a an example to the specs to make sure that the field is populated.

@jon-sully
Copy link
Contributor Author

@jnraine this is the follow up from the one I closed briefly. Should be squared up now 👍

Copy link
Contributor

@rahearn rahearn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@rahearn rahearn merged commit 5358066 into icalendar:master Oct 29, 2023
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

Successfully merging this pull request may close these issues.

2 participants