Class: HealthDataStandards::Validate::Schema::Validator
- Inherits:
-
Object
- Object
- HealthDataStandards::Validate::Schema::Validator
- Includes:
- BaseValidator
- Defined in:
- lib/health-data-standards/validate/schema_validator.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(name, schema_file) ⇒ Validator
constructor
A new instance of Validator.
-
#validate(document, data = {}) ⇒ Object
Validate the document against the configured schema.
Methods included from BaseValidator
Constructor Details
Instance Method Details
#validate(document, data = {}) ⇒ Object
Validate the document against the configured schema
14 15 16 17 18 19 20 |
# File 'lib/health-data-standards/validate/schema_validator.rb', line 14 def validate(document,data={}) @xsd.errors.clear doc = get_document(document) @xsd.validate(doc).map do |error| build_error(error., "/", data[:file_name]) end end |