-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Description:
Audit the Ruby driver for structural antipatterns that make the code brittle or surprising, such as Mongo::Cluster.create mutating its argument via instance_variable_set, and other uses of instance_variable_set or similar meta-programming shortcuts. Replace these with clearer, encapsulated designs (e.g., proper initializers, explicit accessors, small helper objects) that preserve behavior while improving maintainability and testability.
Desired workflow for this ticket
- Identify a linter
- Create a subtask under this task
- Tackle subtask and close subtask
Acceptance Criteria:
- All uses of instance_variable_set and similar meta-programming APIs in the driver are cataloged.
- For each site, either:
- The pattern is replaced with a clearer, encapsulated alternative, or
- It is explicitly documented and constrained (e.g., a single well-justified internal helper).
- No behavior regressions in CI, and code in Mongo::Cluster (and other core types) reads as straightforward OO Ruby.