Add compact option to attributes and serialize_structured_value methods #7
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.
This pull request enhances the
StructuredParams::Paramsclass by introducing a newcompactoption to theattributesandserialize_structured_valuemethods, allowing for recursive removal of nil values from structured parameter hashes. The changes also update type signatures and add comprehensive tests to ensure correct behavior.Feature addition: Compact attributes
compactkeyword argument to theattributesandserialize_structured_valuemethods inlib/structured_params/params.rb, enabling recursive removal of nil values from returned hashes. [1] [2]Type signature updates
attributesandserialize_structured_valuemethod signatures insig/structured_params/params.rbsto reflect the newcompactargument and its accepted combinations. [1] [2]Test coverage
spec/params_spec.rbto cover the newcompactoption, including cases with nested hashes, arrays, and symbolized keys, verifying that nil values are removed as expected. [1] [2]