Class: BELParser::Language::Semantics::RelationshipNotMultipleWarning
- Inherits:
-
SemanticsWarning
- Object
- SemanticsResult
- SemanticsWarning
- BELParser::Language::Semantics::RelationshipNotMultipleWarning
- Defined in:
- lib/bel_parser/language/semantics/relationship_not_listable.rb
Overview
Represents a SemanticsWarning when a statement has a relationship that cannot reference multiple objects.
Instance Attribute Summary
Attributes inherited from SemanticsResult
#expression_node, #specification
Instance Method Summary collapse
-
#initialize(statement_node, spec, rel) ⇒ RelationshipNotMultipleWarning
constructor
A new instance of RelationshipNotMultipleWarning.
- #to_s ⇒ Object
Methods inherited from SemanticsWarning
Methods inherited from SemanticsResult
Constructor Details
#initialize(statement_node, spec, rel) ⇒ RelationshipNotMultipleWarning
Returns a new instance of RelationshipNotMultipleWarning.
42 43 44 45 |
# File 'lib/bel_parser/language/semantics/relationship_not_listable.rb', line 42 def initialize(statement_node, spec, rel) super(statement_node, spec) @rel = rel end |
Instance Method Details
#to_s ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/bel_parser/language/semantics/relationship_not_listable.rb', line 47 def to_s multiple_relationships = @specification .listable_relationships .map(&:long) .join(', ') <<-MSG.gsub(/ {12}/, '').strip Statement must use a multiple relationship with a list object. The "#{@rel.long}" relationship cannot reference multiple objects. Multiple Relationships: #{multiple_relationships} MSG end |