Method: SmartCore::Validator::Contract.call

Defined in:
lib/smart_core/validator/contract.rb

.call(data_to_validate, **kwargs) ⇒ Object

NOTE: In Ruby 2.6.x need to initialize instance without arguments if they not expected.



19
20
21
22
# File 'lib/smart_core/validator/contract.rb', line 19

def call(data_to_validate, **kwargs)
  instance = kwargs.empty? ? new : new(**kwargs)
  instance.call(data_to_validate)
end