fnando / cpf_cnpj

🇧🇷 Validate, generate and format CPF/CNPJ numbers. Include command-line tools.
MIT License
239 stars 42 forks source link

Decision for #valid? return #38

Closed rafaeldev closed 2 weeks ago

rafaeldev commented 2 months ago

Is any decision to been #valid? methods returns nil instead of false?

https://github.com/fnando/cpf_cnpj/blob/e31d0169789edc14717440f87a5eb3d4565be5db/lib/cpf.rb#L58

fnando commented 2 weeks ago

There's no requirement to return a boolean, as nil is also a falsy value. I usually just don't bother to return a false.

I formatted all the files with rubocop and they replaced this with false, so I'm not particularly keen on switching this back.

Closed via aad75f946b4ef874573b9b99f337126f45fb4a44