Class: Chemicalml::Convention::Compchem::Constraints::JobListModuleMustHaveId

Inherits:
Chemicalml::Convention::Constraint::NodeConstraint show all
Includes:
ModulePredicates
Defined in:
lib/chemicalml/convention/compchem/constraints/job_list_module_must_have_id.rb

Overview

A jobList module MUST have an id unique within the compchem module.

Instance Method Summary collapse

Methods included from ModulePredicates

#calculation_module?, #child_modules_with, #cml_module?, #compchem_root?, #environment_module?, #finalization_module?, #initialization_module?, #job_list_module?, #job_module?

Methods inherited from Chemicalml::Convention::Constraint::NodeConstraint

#check

Instance Method Details

#check_node(node, path) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/chemicalml/convention/compchem/constraints/job_list_module_must_have_id.rb', line 13

def check_node(node, path)
  return [] unless node.dict_ref == 'compchem:jobList'
  return [] unless node.id.to_s.empty?

  [violation(path: path.join('/'),
             message: 'jobList module must have an id unique within the compchem module')]
end