Class: BELParser::Language::Semantics::SemanticsInvalidProteinModificationWarning

Inherits:
SemanticsWarning show all
Defined in:
lib/bel_parser/language/semantics_ast_warnings.rb

Instance Attribute Summary

Attributes inherited from SemanticsResult

#expression_node, #specification

Instance Method Summary collapse

Methods inherited from SemanticsWarning

#failure?, #success?

Methods inherited from SemanticsResult

#failure?, #msg, #success?

Constructor Details

#initialize(expression_node, spec, expected_protein_modifications) ⇒ SemanticsInvalidProteinModificationWarning

Returns a new instance of SemanticsInvalidProteinModificationWarning.



134
135
136
137
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 134

def initialize(expression_node, spec, expected_protein_modifications)
  super(expression_node, spec)
  @expected_protein_modifications = expected_protein_modifications
end

Instance Method Details

#to_sObject



139
140
141
142
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 139

def to_s
  pmod = @expression_node.children[0].string_literal
  %(Protein modification of "#{pmod}" does not match allowed protein modifications: #{@expected_protein_modifications.join(', ')})
end