module CqmValidators::BaseValidator

Public Instance Methods

build_error(msg, loc, file_name) click to toggle source
# File lib/base_validator.rb, line 5
def build_error(msg, loc, file_name)
  ValidationError.new(message: msg, location: loc, file_name: file_name, validator: @name)
end
get_document(input) click to toggle source
# File lib/base_validator.rb, line 9
def get_document(input)
  doc = case input
        when File
          input.rewind
          input.read
        when Nokogiri::XML::Document
          return input
        else
          input
        end
  Nokogiri::XML(doc.to_s) { |conf| conf.strict.nonet.noblanks } # grumble, grumble nokogiri java @SS
end