Normalize Endpoint constructor inputs into an internal Data value object#2735
Open
ericproulx wants to merge 1 commit into
Open
Normalize Endpoint constructor inputs into an internal Data value object#2735ericproulx wants to merge 1 commit into
ericproulx wants to merge 1 commit into
Conversation
c7bbd51 to
e797ee6
Compare
Danger ReportNo issues found. |
1c8b6c0 to
7928ac5
Compare
dblock
approved these changes
May 25, 2026
Base automatically changed from
refactor/endpoint-options-route-enabled
to
master
May 25, 2026 20:28
…lue object Introduces `Grape::Endpoint::Options`, a `Data.define` value object built once from the `**options` Hash in `Endpoint#initialize`. Internal call sites read named accessors (`config.path`, `config.app`, etc.) instead of poking `@options[:...]`. The public surface is unchanged: `Endpoint.new(new_settings, **options, &block)` still takes a Hash, and `attr_reader :options` still returns that Hash — so downstream gems (e.g. grape-swagger) that read `endpoint.options[:app]` continue to work. `:method` is renamed to `:http_methods` on the value object to avoid shadowing `Object#method` via the generated Data accessor. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7928ac5 to
0555ad2
Compare
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.
Stacked on top of #2734.
Summary
Grape::Endpoint::Options, aData.definevalue object built once from the**optionsHash inEndpoint#initialize. Internal call sites read named accessors (config.path,config.app, etc.) instead of poking@options[:...].Endpoint.new(new_settings, **options, &block)still takes a Hash, andattr_reader :optionsstill returns that Hash — so downstream gems (e.g. grape-swagger) that readendpoint.options[:app]continue to work.:methodis renamed to:http_methodson the value object to avoid shadowingObject#methodvia the generated Data accessor.Test plan
bundle exec rspec— 2313 examples, 0 failuresbundle exec rubocop— clean on touched files🤖 Generated with Claude Code