Class: Chemicalml::Convention::Molecular::Constraints::AtomMustHaveElementType
- Inherits:
-
Constraint::NodeConstraint
- Object
- Constraint
- Constraint::NodeConstraint
- Chemicalml::Convention::Molecular::Constraints::AtomMustHaveElementType
- Defined in:
- lib/chemicalml/convention/molecular/constraints/atom_must_have_element_type.rb
Instance Method Summary collapse
Methods inherited from Constraint::NodeConstraint
Instance Method Details
#check_node(node, path) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/chemicalml/convention/molecular/constraints/atom_must_have_element_type.rb', line 8 def check_node(node, path) return [] unless node.is_a?(Chemicalml::Cml::Role::Atom) return [] unless node.element_type.to_s.empty? [violation(path: path.empty? ? "atom" : path.join("/"), message: "atom must have an elementType attribute")] end |