Module: CLLI::Validations::ClassMethods

Defined in:
lib/clli/validations.rb

Overview

These methods will be available in the CLLI class.

Instance Method Summary collapse

Instance Method Details

#validate(str, attributes, **options) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/clli/validations.rb', line 15

def validate(str, attributes, **options)
  validate_place(str, attributes[:place], options)
  validate_region(str, attributes[:region], options)
  %i(network_site entity_code location_code location_id customer_code customer_id).each do |attribute|
    send("validate_#{attribute}", str, attributes[attribute], options) if attributes.key?(attribute)
  end
end