Class: BELParser::Language::Semantics::SemanticsInvalidNamespaceWarning

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_namespaces) ⇒ SemanticsInvalidNamespaceWarning

Returns a new instance of SemanticsInvalidNamespaceWarning.



73
74
75
76
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 73

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

Instance Method Details

#to_sObject



78
79
80
81
82
83
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 78

def to_s
  namespace =
    @expression_node.namespace &&
    @expression_node.namespace.identifier
  %(Invalid namespace "#{namespace}". Was expecting one of: #{@expected_namespaces.join(', ')})
end