Class: ReferenceExtractor::Internal::Parsers::ParseResult
- Inherits:
-
Object
- Object
- ReferenceExtractor::Internal::Parsers::ParseResult
- Defined in:
- lib/reference_extractor/internal/parsers/parse_result.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(file:, message:, location: nil) ⇒ ParseResult
constructor
A new instance of ParseResult.
- #to_s(style = OutputStyles::Plain.new) ⇒ Object
Constructor Details
#initialize(file:, message:, location: nil) ⇒ ParseResult
Returns a new instance of ParseResult.
13 14 15 16 17 |
# File 'lib/reference_extractor/internal/parsers/parse_result.rb', line 13 def initialize(file:, message:, location: nil) @location = location @file = file = end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
10 11 12 |
# File 'lib/reference_extractor/internal/parsers/parse_result.rb', line 10 def file @file end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
9 10 11 |
# File 'lib/reference_extractor/internal/parsers/parse_result.rb', line 9 def location @location end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
11 12 13 |
# File 'lib/reference_extractor/internal/parsers/parse_result.rb', line 11 def end |
Instance Method Details
#to_s(style = OutputStyles::Plain.new) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/reference_extractor/internal/parsers/parse_result.rb', line 19 def to_s(style = OutputStyles::Plain.new) location = self.location if location " \#{style.filename}\#{file}\#{style.reset}:\#{location.line}:\#{location.column}\n \#{@message}\n EOS\n else\n <<~EOS\n \#{style.filename}\#{file}\#{style.reset}\n \#{@message}\n EOS\n end\nend\n" |