Usage
Add to your Gemfile:
gem 'cuit_validator'Run:
bundle install
Then add the following to your model:
validates :my_cuit, :cuit => trueValidation outside a model
If you need to validate the cuit outside a model:
Normal mode
CuitValidator.valid?('20-11111111-2') # booleanThread safety
This gem is thread safe, with one caveat: CuitValidator.default_options must be configured before use in a multi-threaded environment. If you configure default_options in a Rails initializer file, then you're good to go since initializers are run before worker threads are spawned.