Remove namespace_stackable_with_hash
from public interface
#2603
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.
Remove
namespace_stackable_with_hash
from public interfaceSummary
This PR refactors the internal implementation of
namespace_stackable_with_hash
by moving it from the public DSL interface to the internalInheritableSetting
class, making it a private implementation detail rather than part of the public API.Changes Made
Core Refactoring
namespace_stackable_with_hash
fromGrape::DSL::Settings
toGrape::Util::InheritableSetting
inheritable_setting.namespace_stackable_with_hash
instead of the direct method callFiles Modified
lib/grape/dsl/inside_route.rb
- Updated entity class detection logiclib/grape/dsl/parameters.rb
- Updated named params handlinglib/grape/dsl/request_response.rb
- Updated content types handlinglib/grape/dsl/routing.rb
- Updated route options handlinglib/grape/dsl/settings.rb
- Removed public methodlib/grape/endpoint.rb
- Updated middleware stack buildinglib/grape/util/inheritable_setting.rb
- Added the method as private implementationTest Updates
Configuration
AbcSize
limit from 45 to 50 to accommodate the refactored code structureBenefits
InheritableSetting
classBreaking Changes
None - This is purely an internal refactoring. The public API remains unchanged, and all existing functionality continues to work as expected.
Testing
Related Issues
This refactoring improves the internal architecture of Grape by better encapsulating implementation details and providing a cleaner separation between public and private APIs.