Closed umair-ably closed 1 month ago
[!NOTE]
Reviews paused
Use the following commands to manage reviews:
@coderabbitai resume
to resume automatic reviews.@coderabbitai review
to trigger a single review.
The changes in this pull request involve modifications to the ARTPaginatedResult
class in both the implementation and header files. A new instance variable _initializedViaInit
is introduced to track the initialization state of the object, influencing method behavior based on whether the object was initialized with the default or a custom initializer. The init
method is now a designated initializer, allowing instantiation but enforcing subclassing for certain methods. This structure aims to enhance control over object initialization and method usage.
File | Change Summary |
---|---|
Source/ARTPaginatedResult.m | Introduced _initializedViaInit to track initialization state. Modified init and initWithItems: methods. Added checks for _initializedViaInit in hasNext , isLast , items , first: , and next: methods. |
Source/include/Ably/ARTPaginatedResult.h | Changed init method from unavailable to designated initializer, allowing instantiation with restrictions. Expanded comments for clarity. |
In the land of code where rabbits play,
A new state tracker came to stay.
With methods that check and rules to abide,
Our paginated friend now takes pride.
So hop along, let’s subclass and cheer,
For the changes made, we hold dear! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@umair-ably please can you change it so that I am not listed as the commit's sole author? It gives the impression that I wrote all of the code that's in here, which I didn't (e.g. initializedViaInitCheck
). My preference would be for you to change the author to be you (since you wrote the commit message) and to add me as a co-author.
Allow mocking of ARTPaginatedResult by passing responsibility of property initialisation to any subclassing parties
This commit message isn't quite right. The base class remains responsible for initialising its own properties. A more accurate description would be "by allowing it to be subclassed by a user of the SDK".
@coderabbitai pause
@coderabbitai pause
Allow mocking of ARTPaginatedResult by passing responsibility of property initialisation to any subclassing parties
Summary by CodeRabbit
New Features
ARTPaginatedResult
class, allowing for better control over object instantiation.hasNext
,isLast
, anditems
).Bug Fixes
Documentation
init
method to clarify its intended use and restrictions for subclasses.