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

Name matching predicate #324

Open
dangalipo opened this issue Apr 19, 2017 · 1 comment
Open

Name matching predicate #324

dangalipo opened this issue Apr 19, 2017 · 1 comment

Comments

@dangalipo
Copy link

Hi,

I occasionally run into the situation where I need to return a random name that meets some condition (i.e. has a length > 2 for autocomplete).

I was thinking of putting up a PR that changes the name methods to take and optional block and will return the first value that matches a predicate. Would this be a welcome feature?

@marocchino
Copy link
Member

I think add matching predicate for every method is too much.

But, It would be okay to have a utility that is universally usable.

FFaker::Name.only { |str| str.size > 2 }.first_name

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

No branches or pull requests

2 participants