Internalize versioning state behind Grape::Util::InheritableSetting accessors#2806
Open
ericproulx wants to merge 1 commit into
Open
Internalize versioning state behind Grape::Util::InheritableSetting accessors#2806ericproulx wants to merge 1 commit into
ericproulx wants to merge 1 commit into
Conversation
…ccessors Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Danger ReportNo issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Second batch of the
namespace_inheritablecleanup (after #2805; #2795–#2804 covered the stackable side): the versioning state written by theversion,prefixandcascadeDSL methods is now recorded and read through intention-revealing accessors onGrape::Util::InheritableSetting.New accessors on
InheritableSettingversion/version=namespace_inheritable[:version]version_options/version_options=namespace_inheritable[:version_options]root_prefix/root_prefix=namespace_inheritable[:root_prefix]cascade/cascade=/cascade_defined?namespace_inheritable[:cascade]/.key?(:cascade)Notes:
cascadeis the one subtle key: an explicitly assignednilis meaningful and distinct from never-set (InheritableValues#[]is key-presence based viafetch), so the accessor family includescascade_defined?. Both presence checks —DSL::Routing#cascade's getter andGrape::API::Instance#cascade?'s fallback chain (explicit cascade →version_options.cascade→true) — now read through it, and the semantics are documented on the accessor instead of implied at two call sites.cascadelives in this PR rather than a flags PR becauseInstance#cascade?also readsversion_options— keeping the whole fallback chain in one conversion avoids two standalone PRs editing the same method.DSL::Routing(version,prefix,cascade),Endpoint(to_routes,build_stackversioner setup — the reader absorbs nothing here since.flatten/.present?are caller concerns),Grape::API::Instance#cascade?, and theDSL::VersionOptionsdoc comment.=(see Internalize format and error-response defaults behind Grape::Util::InheritableSetting accessors #2805 for the naming rationale).🤖 Generated with Claude Code