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

Adding '**' to make opts ruby 3.2+ compliant #68

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

peterb-onramp
Copy link
Contributor

def initialize opts
opts[:id] ||= opts[:key]
raise ArgumentError.new ":key is required" unless opts[:id].is_a? String
is not ruby 3.2+ keywords compliant.

https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/

Methods taking a rest parameter (like *args) and wishing to delegate keyword arguments through foo(*args) must now be marked with ruby2_keywords (if not already the case). In other words, all methods wishing to delegate keyword arguments through *args must now be marked with ruby2_keywords, with no exception. This will make it easier to transition to other ways of delegation once a library can require Ruby 3+. Previously, the ruby2_keywords flag was kept if the receiving method took *args, but this was a bug and an inconsistency. A good technique to find potentially missing ruby2_keywords is to run the test suite, find the last method which must receive keyword arguments for each place where the test suite fails, and use puts nil, caller, nil there. Then check that each method/block on the call chain which must delegate keywords is correctly marked with ruby2_keywords

To fix we add the '**' before the opts parameter and this resolved the issue.

Copy link
Contributor

@ShreyaThapa ShreyaThapa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @peterb-onramp! We are grateful for your time and effort. We've reviewed and approved the changes. We will merge into the main branch and include in the next release.

Thanks again for your contributions and for being a part of our community!

@ShreyaThapa ShreyaThapa merged commit 450e7bc into Dwolla:main Mar 15, 2023
@ShreyaThapa ShreyaThapa linked an issue Mar 15, 2023 that may be closed by this pull request
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.

Ruby 3.2+ Keywords Error In Lib/Client.rb
2 participants