Class: SimpleSchema::ValidatorProperties

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_schema/validator_properties.rb

Class Method Summary collapse

Class Method Details

.build(data, schema, class_options, options) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/simple_schema/validator_properties.rb', line 3

def self.build(data, schema, class_options, options)
  return false unless (schema[:type] == :object)
  begin
    validator = Validator::new(schema[:properties], class_options)
    validator.validate!(data, options)
 rescue InvalidDataType
    raise MissingAttribute.new(options[:path])
  end
end