Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pin::DelegatedMethod #602

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

grncdr
Copy link
Contributor

@grncdr grncdr commented Sep 29, 2022

This is a more complicated version of a method alias, where the type of the method receiver can be resolved dynamically using a Source::Chain.

The idea didn't get much of a response in #591, but I really wanted to implement proper support for the Module.delegate method from ActiveSupport. You can see how it's used in my solargraph-rails work here.

I'd really like to get this merged, and I'm happy to add specs for it, but I want to get feedback on the implementation, as it's a pretty "unusual" pin type.

@grncdr
Copy link
Contributor Author

grncdr commented Oct 6, 2022

@castwide not sure if you get notified for draft PRs, but I would definitely appreciate your thoughts on this one before moving forward.

@castwide
Copy link
Owner

castwide commented Dec 8, 2022

Sorry for the long delay. This looks like a solid start. It might also be useful for implementing proper support of the !@macro directive. I'll pull it down and play with it, but right now I don't see any red flags.

@grncdr grncdr force-pushed the delegated-method-pin branch 2 times, most recently from 0a98ee7 to e961c1c Compare January 8, 2023 22:37
@grncdr grncdr marked this pull request as ready for review January 9, 2023 09:45
@grncdr grncdr force-pushed the delegated-method-pin branch from 930a66b to 76d902c Compare February 8, 2023 09:24
grncdr added 3 commits May 7, 2023 13:05
This is a more complicated version of a method alias, where the type
of the method receiver can be resolved dynamically using a Source::Chain.

As hinted at by the name, this allows creating pins that fully support
the `Module.delegate` method from ActiveSupports core extensions.
@grncdr grncdr force-pushed the delegated-method-pin branch from 76d902c to 145618b Compare May 7, 2023 11:05
@grncdr
Copy link
Contributor Author

grncdr commented May 7, 2023

Hi @castwide, I've just rebased my branch on the latest master, did you have a chance to try it out?

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.

2 participants