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

[Feature #14145] Method parameters inspect #2618

Merged
merged 3 commits into from Nov 20, 2019

Conversation

@zverok
Copy link
Contributor

zverok commented Oct 27, 2019

Example:

def m(a, b=nil, *c, d:, e: nil, **rest, &block)
end

p method(:m)
#=> #<Method: m(a, b=..., *c, d:, e: ..., **rest, &block) ...>

Implementation is most probably not optimal (to say the least), I am ready to fix it by comments. At least the tests and implementation should handle all possible cases.

UPD 2019-11-20: Representation of default and noname params changed after discussion with @ko1 on bugs.ruby-lang.org

@zverok zverok changed the title Method parameters inspect [Feature #14145] Method parameters inspect Oct 27, 2019
zverok added 3 commits Oct 27, 2019
Example:

    def m(a, b=nil, *c, d:, e: nil, **rest, &block)
    end
    p method(:m)
    #=> #<Method: m(a, b=<default>, *c, d:, e: <default>, **rest, &block) ...>
@zverok zverok force-pushed the zverok:method-inspect-parameters branch from f104742 to 34a913d Nov 20, 2019
@ko1 ko1 merged commit 50cc934 into ruby:master Nov 20, 2019
14 checks passed
14 checks passed
test (--jit)
Details
check_branch
Details
make (check, ubuntu-latest)
Details
make (test, windows-2016, 2017)
Details
make (check)
Details
test (--jit-wait)
Details
make (check, ubuntu-16.04)
Details
make (test, windows-2019, 2019)
Details
make (test-bundler)
Details
make (test-bundler, ubuntu-latest)
Details
make (test-bundled-gems)
Details
make (test-bundled-gems, ubuntu-latest)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zverok zverok deleted the zverok:method-inspect-parameters branch Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.