Skip to content

Protect internal accessors#5

Merged
afuno merged 3 commits intomainfrom
feature/SRV-446/improvements
Feb 13, 2026
Merged

Protect internal accessors#5
afuno merged 3 commits intomainfrom
feature/SRV-446/improvements

Conversation

@afuno
Copy link
Copy Markdown
Member

@afuno afuno commented Feb 13, 2026

No description provided.

- Replace `instance_variable_get` with `attr_reader` for protected attributes in `Setting`, `RegistrySettings`, `Collection`, and `Hooks::Collection` classes to ensure safer and cleaner access.
- Update `initialize_dup` methods to use the new protected attribute readers.
- Add protected visibility for attribute readers to encapsulate internal state.
- Add comments explaining the use of protected `attr_reader` declarations in `Setting`, `RegistrySettings`, `Collection`, and `Hooks::Collection` classes for Steep visibility.
- Retain protected visibility to encapsulate internal state while enabling use in `initialize_dup`.
@afuno afuno self-assigned this Feb 13, 2026
@afuno afuno added the polish label Feb 13, 2026
- Add tests to ensure internal attributes (`collection`, `storage`, and `data`) in `Hooks::Collection`, `Settings::Collection`, `RegistrySettings`, and `Settings::Setting` remain inaccessible via public interface.
- Verify `NoMethodError` is raised when attempting public access to these protected attributes.
@afuno afuno marked this pull request as ready for review February 13, 2026 14:06
@afuno afuno merged commit 8ff424f into main Feb 13, 2026
35 checks passed
@afuno afuno deleted the feature/SRV-446/improvements branch February 13, 2026 14:07
@afuno afuno added this to the v0.x milestone Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant