Class: MetadataCop::Cop::Xml::Lint::SchemaValid

Inherits:
Valid
  • Object
show all
Defined in:
lib/metadatacop/cop/xml/lint/schema_valid.rb

Instance Attribute Summary

Attributes inherited from BaseCop

#options

Instance Method Summary collapse

Methods inherited from BaseCop

#initialize, #lint?, #message, #offense

Constructor Details

This class inherits a constructor from MetadataCop::Cop::BaseCop

Instance Method Details

#investigate(file) ⇒ Object



6
7
8
9
10
# File 'lib/metadatacop/cop/xml/lint/schema_valid.rb', line 6

def investigate(file)
  doc = Nokogiri::XML(File.read(file))

  xsd.validate(doc).map { |m| offense(m) }
end