Class: Proteus::Validators::BaseValidator

Inherits:
Object
  • Object
show all
Includes:
ValidationDSL, ValidationHelpers
Defined in:
lib/proteus/validators/base_validator.rb

Direct Known Subclasses

Config::ConfigValidator

Instance Method Summary collapse

Methods included from ValidationHelpers

#keys_to_hierarchy

Methods included from ValidationDSL

#collect, #current_data, #each, #each_key, #ensure_data_type, #ensure_keys, #ensure_presence, #ensure_unique_values, #ensure_uniqueness_across, #ensure_value, #in_case, #init, #peek, #transform_to_paths, #within

Constructor Details

#initialize(data, environment = nil) ⇒ BaseValidator

Returns a new instance of BaseValidator.



11
12
13
14
15
# File 'lib/proteus/validators/base_validator.rb', line 11

def initialize(data, environment = nil)
  @data = data
  @environment = environment
  validate
end