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

Use keyword arguments instead of options hash #37

Merged
merged 2 commits into from Dec 4, 2017

Conversation

styd
Copy link
Collaborator

@styd styd commented Dec 4, 2017

Prefer to use keyword arguments to options hash for these reasons:

  • Fewer characters or lines of code to type.
  • We can immediately discover the names of the arguments without having to read the body of the method.
  • Less chance of typos if in the future we want to add new arguments since we don’t have to write the boilerplate code to extract hash options.

Source: Ruby 2 Keyword Arguments

@radar
Copy link
Owner

radar commented Dec 4, 2017

This would break compatibility with versions older than 2.0.

I am completely fine with that.

People have had enough time to upgrade.

You should force the Ruby version to be greater than 2.0 in the gemspec to avoid any surprises.

@styd
Copy link
Collaborator Author

styd commented Dec 4, 2017

Yes, exactly. I'm sure most people already use Ruby 2 because versions older than that are no longer supported long ago. In fact, even support for Ruby 2.1 has ended on April this year. Ok, I'm gonna merge this. Thanks, @radar.
Anyway, I think these changes deserved a version upgrade, don't you think?

@styd styd merged commit 975da0d into radar:master Dec 4, 2017
@styd styd deleted the keyword-arguments branch December 4, 2017 08:01
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.

None yet

2 participants