Refactor category property to getter in daily learning events#12
Merged
Conversation
Add a `get category(): string | undefined` property getter to the DailyLearningEvent base class returning undefined by default, documented as the category name used as the location field in iCalendar event feeds. Convert all subclasses that set `this.category = 'string'` in their constructors to instead override the getter and return the string directly. DailyChapterEvent, which receives category as a constructor parameter, uses a private backing field with a getter override. https://claude.ai/code/session_01Pi9ATpcqnm1iHZmdAsXzBm
Mark both classes abstract. Remove the category constructor parameter
from DailyChapterEvent and replace the private-field getter with
category getter overrides in NachYomiEvent ('Nach Yomi') and
PerekYomiEvent ('Perek Yomi').
https://claude.ai/code/session_01Pi9ATpcqnm1iHZmdAsXzBm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored the
categoryproperty from a constructor-assigned instance field to a getter method across all daily learning event classes. This change improves code maintainability by centralizing category definitions and reducing constructor complexity.Key Changes
DailyLearningEventandDailyChapterEventabstract base classescategoryfrom an instance property to a getter method inDailyLearningEvent(returnsundefinedby default)categoryparameter fromDailyChapterEventconstructorcategorygetter in all concrete event classes:ArukhHaShulchanYomiEventChofetzChaimEventDailyRambamEventandDailyRambam3EventDirshuAmudYomiEventKitzurShulchanAruchEventMishnaYomiEventNachYomiEventPerekYomiEventPirkeiAvotSummerEventPsalmsEventSeferHaMitzvotEventShemiratHaLashonEventYerushalmiYomiEventDafYomiEvent,DafWeeklyEvent,TanakhYomiEventcategoryfield assignment from all constructorscategoryfield fromDafPageEventImplementation Details
undefined, allowing subclasses to optionally override ithttps://claude.ai/code/session_01Pi9ATpcqnm1iHZmdAsXzBm