Class: BELParser::Language::Syntax::SyntaxResult
- Inherits:
-
Object
- Object
- BELParser::Language::Syntax::SyntaxResult
- Defined in:
- lib/bel_parser/language/syntax_result.rb
Overview
SyntaxResult represents the result of running a SyntaxFunction.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#expression_node ⇒ Object
readonly
Returns the value of attribute expression_node.
-
#specification ⇒ Object
readonly
Returns the value of attribute specification.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(expression_node, specification) ⇒ SyntaxResult
constructor
A new instance of SyntaxResult.
- #msg ⇒ Object abstract
- #success? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(expression_node, specification) ⇒ SyntaxResult
Returns a new instance of SyntaxResult.
8 9 10 11 |
# File 'lib/bel_parser/language/syntax_result.rb', line 8 def initialize(expression_node, specification) @expression_node = expression_node @specification = specification end |
Instance Attribute Details
#expression_node ⇒ Object (readonly)
Returns the value of attribute expression_node.
6 7 8 |
# File 'lib/bel_parser/language/syntax_result.rb', line 6 def expression_node @expression_node end |
#specification ⇒ Object (readonly)
Returns the value of attribute specification.
6 7 8 |
# File 'lib/bel_parser/language/syntax_result.rb', line 6 def specification @specification end |
Instance Method Details
#failure? ⇒ Boolean
17 18 19 |
# File 'lib/bel_parser/language/syntax_result.rb', line 17 def failure? false end |
#msg ⇒ Object
This method is abstract.
Subclass and override #msg to provide the message.
22 23 24 |
# File 'lib/bel_parser/language/syntax_result.rb', line 22 def msg raise NotImplementedError, "#{__method__} is not implemented." end |
#success? ⇒ Boolean
13 14 15 |
# File 'lib/bel_parser/language/syntax_result.rb', line 13 def success? true end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/bel_parser/language/syntax_result.rb', line 26 def to_s "Info: #{msg}" end |