class BELParser::Language::Semantics::SemanticCovalentProteinModificationOf

AST node for CovalentProteinModificationOf is a semantic AST.

Public Class Methods

new(mod_types, **properties) click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 687
def initialize(mod_types, **properties)
  properties[:hashed] = Hash[mod_types.map { |t| [t, true] }]
  super(:covalent_protein_modification_of, mod_types, properties)
end

Public Instance Methods

covalent_protein_modification_types() click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 692
def covalent_protein_modification_types
  children
end
match(value_node, spec, will_match_partial = false) click to toggle source
# File lib/bel_parser/language/semantics_ast.rb, line 696
def match(value_node, spec, will_match_partial = false)
  string_literal_sym = value_node.children[0].string_literal.to_sym
  return success(value_node, spec) if @hashed[:*]

  if @hashed.key?(string_literal_sym)
    success(value_node, spec)
  else
    invalid_protein_modification_warning(
      value_node,
      spec,
      @hashed.keys)
  end
end