Class: OmfCommon::RelaxNGSchema
- Inherits:
-
Object
- Object
- OmfCommon::RelaxNGSchema
- Includes:
- Singleton
- Defined in:
- omf_common/lib/omf_common/message/xml/relaxng_schema.rb
Constant Summary
- SCHEMA_FILE =
"#{File.dirname(__FILE__)}/../../protocol/#{OmfCommon::PROTOCOL_VERSION}.rng"
Instance Method Summary (collapse)
-
- (RelaxNGSchema) initialize
constructor
A new instance of RelaxNGSchema.
- - (Object) validate(document)
Constructor Details
- (RelaxNGSchema) initialize
Returns a new instance of RelaxNGSchema
14 15 16 |
# File 'omf_common/lib/omf_common/message/xml/relaxng_schema.rb', line 14 def initialize @rng = File.read(SCHEMA_FILE) end |
Instance Method Details
- (Object) validate(document)
18 19 20 |
# File 'omf_common/lib/omf_common/message/xml/relaxng_schema.rb', line 18 def validate(document) Nokogiri::XML::RelaxNG(@rng).validate(document) end |