Skip to content

Extract Entity DSL and refactor :with to keyword argument#2679

Open
ericproulx wants to merge 2 commits intomasterfrom
extract_entity_dsl_and_kwargs_with
Open

Extract Entity DSL and refactor :with to keyword argument#2679
ericproulx wants to merge 2 commits intomasterfrom
extract_entity_dsl_and_kwargs_with

Conversation

@ericproulx
Copy link
Copy Markdown
Contributor

Summary

  • Extract entity-related methods (present, entity_class_for_obj, entity_representation_for) from Grape::DSL::InsideRoute into a new Grape::DSL::Entity module
  • Convert options[:with] hash pattern to explicit with: keyword argument in error_formatter, rescue_from, represent, and ErrorFormatter::Base#present
  • Remove dead code and simplify conditional logic as a result of the keyword arg refactor

Test plan

  • bundle exec rspec passes (excluding pre-existing failure in spec/grape/exceptions/validation_spec.rb:15)
  • Verify rescue_from, represent, error_formatter, and entity presentation still work end-to-end

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Danger Report

No issues found.

View run

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ericproulx ericproulx force-pushed the extract_entity_dsl_and_kwargs_with branch from 11fdb3d to ac77bb3 Compare April 8, 2026 21:08
- Move entity-related methods (present, entity_class_for_obj, entity_representation_for)
  from InsideRoute into a new Grape::DSL::Entity module
- Convert options[:with] hash pattern to explicit `with:` keyword argument in rescue_from, represent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ericproulx ericproulx force-pushed the extract_entity_dsl_and_kwargs_with branch from ac77bb3 to 96e1589 Compare April 8, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant