Skip to content

Introduce SerializationDepth value object to reduce primitive obsession#13

Merged
johngallagher merged 1 commit into
claude/fix-code-smells-o11wKfrom
claude/fix-serialization-depth-obsession-o11wK
Mar 9, 2026
Merged

Introduce SerializationDepth value object to reduce primitive obsession#13
johngallagher merged 1 commit into
claude/fix-code-smells-o11wKfrom
claude/fix-serialization-depth-obsession-o11wK

Conversation

@johngallagher

Copy link
Copy Markdown
Contributor

Extracts serialization depth configuration logic into a dedicated SerializationDepth class, removing the get_serialization_depth_for_class method from Instrumenter and replacing primitive type-checking with a proper value object.

get_serialization_depth_for_class was doing type-checking (is Integer or Hash?),
key-coercion (symbol vs string), and falling back to a hardcoded default — all
inline. Extract that logic into Observable::SerializationDepth#for_class, making
Instrumenter unaware of how depth config is shaped.

https://claude.ai/code/session_01KWZUse79XR68i6nGa8VgTu
@johngallagher johngallagher merged commit 99851c9 into claude/fix-code-smells-o11wK Mar 9, 2026
23 checks passed
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