Class: BELParser::Language::Semantics::NonCausalNestedStatementWarning
- Inherits:
-
SemanticsWarning
- Object
- SemanticsResult
- SemanticsWarning
- BELParser::Language::Semantics::NonCausalNestedStatementWarning
- Defined in:
- lib/bel_parser/language/semantics/non_causal_nested_statement.rb
Overview
Represents a SemanticsWarning when a nested Parsers::AST::Statement has a non-causal relationship.
Instance Attribute Summary collapse
-
#non_causal_relationship ⇒ Object
readonly
Returns the value of attribute non_causal_relationship.
Attributes inherited from SemanticsResult
#expression_node, #specification
Instance Method Summary collapse
-
#initialize(stmt_node, spec, rel) ⇒ NonCausalNestedStatementWarning
constructor
A new instance of NonCausalNestedStatementWarning.
- #to_s ⇒ Object
Methods inherited from SemanticsWarning
Methods inherited from SemanticsResult
Constructor Details
#initialize(stmt_node, spec, rel) ⇒ NonCausalNestedStatementWarning
Returns a new instance of NonCausalNestedStatementWarning.
30 31 32 33 |
# File 'lib/bel_parser/language/semantics/non_causal_nested_statement.rb', line 30 def initialize(stmt_node, spec, rel) super(stmt_node, spec) @non_causal_relationship = spec.relationship(rel) end |
Instance Attribute Details
#non_causal_relationship ⇒ Object (readonly)
Returns the value of attribute non_causal_relationship.
28 29 30 |
# File 'lib/bel_parser/language/semantics/non_causal_nested_statement.rb', line 28 def non_causal_relationship @non_causal_relationship end |
Instance Method Details
#to_s ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/bel_parser/language/semantics/non_causal_nested_statement.rb', line 35 def to_s causal_relationships = @specification .causal_relationships .map(&:long) .join(', ') <<-MSG.gsub(/ {12}/, '') Nested statement is not a causal relationship. The "#{non_causal_relationship.long}" relationship is not causal. Causal Relationships: #{causal_relationships} MSG end |