Class: BELParser::Language::Semantics::SignatureMappingWarning

Inherits:
SemanticsWarning show all
Defined in:
lib/bel_parser/language/semantics/signature_mapping.rb

Overview

SignatureMappingWarning defines a SemanticsWarning that indicates an unsuccessful signature match.

Instance Attribute Summary collapse

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(term_node, spec, signature, results) ⇒ SignatureMappingWarning

Returns a new instance of SignatureMappingWarning.



89
90
91
92
93
# File 'lib/bel_parser/language/semantics/signature_mapping.rb', line 89

def initialize(term_node, spec, signature, results)
  super(term_node, spec)
  @signature = signature
  @results   = results
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



87
88
89
# File 'lib/bel_parser/language/semantics/signature_mapping.rb', line 87

def results
  @results
end

#signatureObject (readonly)

Returns the value of attribute signature.



86
87
88
# File 'lib/bel_parser/language/semantics/signature_mapping.rb', line 86

def signature
  @signature
end

Instance Method Details

#to_sObject



95
96
97
98
99
# File 'lib/bel_parser/language/semantics/signature_mapping.rb', line 95

def to_s
  <<-MSG.gsub(/ {12}/, '').gsub(/\n$/, '')
    Term did not match function signature: #{@signature.string_form}
  MSG
end