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

Suggestion: Convert parameters to keyword arguments #603

Closed
supremebeing7 opened this issue Jun 14, 2016 · 4 comments
Closed

Suggestion: Convert parameters to keyword arguments #603

supremebeing7 opened this issue Jun 14, 2016 · 4 comments

Comments

@supremebeing7
Copy link

I find myself using Faker::Internet.slug pretty regularly, but I almost never need to specify words and almost always specify the glue. So, my tests and factories are littered with Faker::Internet.slug(nil, '-'). It seems to me it would read better as Faker::Internet.slug(glue: '-').

I think this would also provide some clarity on other Faker classes involving multiple arguments. For example, the somewhat ambiguous

Faker::Lorem.sentence(3, false, 4)

would become

Faker::Lorem.sentence(word_count: 3, supplemental: false, random_words_to_add: 4)

It's more verbose, but I'd prefer that than having to consult the faker docs every time.

@stympy
Copy link
Contributor

stympy commented Jun 14, 2016

I like this idea -- I'd love a PR. :)

This is good timing, as I just dropped Ruby 1.9.3 from Travis, so the next gem version can have breaking changes like this.

@supremebeing7
Copy link
Author

👍

I can try to whip up one in the coming week.

@bpleslie
Copy link
Member

This has been implemented. I think this can be closed now 👍

@vbrazo vbrazo closed this as completed Aug 31, 2019
@vbrazo
Copy link
Member

vbrazo commented Aug 31, 2019

True. Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants