Class: BELParser::Script::Syntax::UnsupportedBELVersionWarning

Inherits:
Language::Syntax::SyntaxWarning show all
Defined in:
lib/bel_parser/script/syntax/unsupported_bel_version.rb

Overview

UnsupportedBELVersionError represents the use of an unsupported BEL version string.

Instance Attribute Summary collapse

Attributes inherited from Language::Syntax::SyntaxResult

#expression_node, #specification

Instance Method Summary collapse

Methods inherited from Language::Syntax::SyntaxWarning

#failure?, #success?, #to_s

Methods inherited from Language::Syntax::SyntaxResult

#failure?, #success?, #to_s

Constructor Details

#initialize(document_property_node, unsupported_version) ⇒ UnsupportedBELVersionWarning

Returns a new instance of UnsupportedBELVersionWarning.



40
41
42
43
44
# File 'lib/bel_parser/script/syntax/unsupported_bel_version.rb', line 40

def initialize(document_property_node, unsupported_version)
  super(document_property_node, nil)
  @unsupported_version = unsupported_version
  @default             = BELParser::Language.default_version
end

Instance Attribute Details

#unsupported_versionObject (readonly)

Gets the unsupported bel version.



38
39
40
# File 'lib/bel_parser/script/syntax/unsupported_bel_version.rb', line 38

def unsupported_version
  @unsupported_version
end

Instance Method Details

#msgObject



46
47
48
49
50
51
# File 'lib/bel_parser/script/syntax/unsupported_bel_version.rb', line 46

def msg
  <<-MSG.gsub(/^ +/, '').delete("\n")
    Unsupported BEL version "#@unsupported_version". 
    Setting BEL version to the default version "#@default".
  MSG
end