Class: ProformaXML::Validator

Inherits:
ServiceBase show all
Defined in:
lib/proformaxml/services/validator.rb

Instance Method Summary collapse

Methods inherited from ServiceBase

call

Constructor Details

#initialize(doc:, expected_version: nil) ⇒ Validator

Returns a new instance of Validator.



5
6
7
8
9
# File 'lib/proformaxml/services/validator.rb', line 5

def initialize(doc:, expected_version: nil)
  super()
  @doc = doc
  @expected_version = expected_version
end

Instance Method Details

#performObject



11
12
13
14
15
16
# File 'lib/proformaxml/services/validator.rb', line 11

def perform
  version_name_extractor = VersionAndNamespaceExtractor.new doc: @doc
  @pro_ns, @doc_schema_version = version_name_extractor.perform&.values_at(:namespace, :version)

  validate
end