Class: Dcc::Validate::Schematron::Rules::SchemaVersionCheck
- Inherits:
-
Base
- Object
- Dcc::Validate::Schematron::Rule
- Base
- Dcc::Validate::Schematron::Rules::SchemaVersionCheck
- Defined in:
- lib/dcc/validate/schematron/rules/schema_version_check.rb
Overview
Warn when the schemaVersion is not the latest known release.
Instance Method Summary collapse
Methods inherited from Dcc::Validate::Schematron::Rule
Instance Method Details
#check_on(dcc) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dcc/validate/schematron/rules/schema_version_check.rb', line 14 def check_on(dcc) return [] unless Dcc::TypeGuards.has_attribute?(dcc, :schema_version) current = dcc.schema_version.to_s latest = ::Dcc::Schema::Version::DCC_LATEST current == latest ? [] : [ issue( severity: :warning, message: "schemaVersion '#{current}' is not the latest release (#{latest})", ), ] end |