Class: Chemicalml::Convention::Spectroscopy::Constraints::SpectrumMustHaveConvention
- Inherits:
-
Constraint::NodeConstraint
- Object
- Constraint
- Constraint::NodeConstraint
- Chemicalml::Convention::Spectroscopy::Constraints::SpectrumMustHaveConvention
- Defined in:
- lib/chemicalml/convention/spectroscopy/constraints/spectrum_must_have_convention.rb
Overview
A <spectrum> MUST declare its own convention attribute so
consumers know how to interpret its format and peaks. Per
the molecular convention: "spectrum — any number, each MUST
specify its own convention".
Instance Method Summary collapse
Methods inherited from Constraint::NodeConstraint
Instance Method Details
#check_node(node, _path) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/chemicalml/convention/spectroscopy/constraints/spectrum_must_have_convention.rb', line 15 def check_node(node, _path) return [] unless node.convention.to_s.empty? [violation(path: yield_path(node), message: "spectrum #{node.id.inspect} must declare its own convention attribute")] end |