Refactor attributes and serialize_structured_value methods to rep…
#9
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 handling of attribute serialization and compaction in
StructuredParams::Params, making the API more flexible and expressive. The main change is replacing the previous booleancompactoption with a newcompact_modekeyword argument, which supports multiple modes for removing blank or nil values. The update also modifies related method signatures, updates type signatures, and adds comprehensive tests for the new behavior.Attribute serialization and compaction improvements
attributesandserialize_structured_valuemethods inlib/structured_params/params.rbnow accept acompact_modekeyword argument (:none,:nil_only, or:all_blank) instead of a simple booleancompact. This allows more granular control over how blank or nil values are removed from serialized output. [1] [2]sig/structured_params/params.rbshave been updated to reflect the newcompact_modeargument and its possible values. [1] [2]Test coverage for new compaction modes
spec/params_spec.rbhave been updated to usecompact_modeinstead ofcompact, and new tests have been added for the:all_blankmode to verify recursive removal of blank values from nested structures. [1] [2] [3] [4]Miscellaneous updates
.rubocop.yml)CHANGELOG.mdfile has been cleaned up by removing outdated entries for unreleased versions.…lacecompactboolean withcompact_modekeyword argument, including updated specs, method signatures, and tests.