ankane / barkick

Barcodes made easy
MIT License
137 stars 12 forks source link

#invalid? method #6

Closed Spone closed 1 year ago

Spone commented 1 year ago

Hi! Thanks for a very useful gem :)

Would you consider adding an #invalid? method that returns the inverse of #valid?, similarly to ActiveModel?

This would make things clearer in some cases:

- return nil if @isbn.blank? || !Barkick::GTIN.new(@isbn, type: :isbn13).valid?
+ return nil if @isbn.blank? || Barkick::GTIN.new(@isbn, type: :isbn13).invalid?

I can dedicate some time to a PR. Let me know.

ankane commented 1 year ago

Hey @Spone, thanks for the suggestion. However, it's not something I'd like to include.

Spone commented 1 year ago

Thanks for the reply.