class BELParser::Script::Syntax::UndefinedAnnotationError

UndefinedAnnotationError represents an undefined annotation seen when checking a SET annotation.

Attributes

prefix[R]

Gets the undefined prefix.

Public Class Methods

new(set_node, prefix, annotation_definitions) click to toggle source
# File lib/bel_parser/script/syntax/undefined_annotation.rb, line 39
def initialize(set_node, prefix, annotation_definitions)
  super(set_node, nil)
  @prefix                 = prefix
  @annotation_definitions = annotation_definitions
end

Public Instance Methods

msg() click to toggle source
# File lib/bel_parser/script/syntax/undefined_annotation.rb, line 45
        def msg
          defined_annotations =
            if @annotation_definitions.empty?
              'No annotations are defined.'
            else
              annotation_prefixes = @annotation_definitions.keys.join(', ')
              "Defined annotations: #{annotation_prefixes}"
            end
          <<-MSG.gsub(/^ +/, '').delete("\n")
            Annotation definition is missing for "#@prefix". 
            #{defined_annotations}
          MSG
        end