Class: Epuber::Checker::TextChecker::MatchProblem
- Inherits:
-
Epuber::Compiler::Problem
- Object
- Epuber::Compiler::Problem
- Epuber::Checker::TextChecker::MatchProblem
- Defined in:
- lib/epuber/checker/text_checker.rb
Instance Attribute Summary
Attributes inherited from Epuber::Compiler::Problem
#file_path, #level, #location, #message, #source
Instance Method Summary collapse
-
#initialize(match, message, file_path) ⇒ MatchProblem
constructor
A new instance of MatchProblem.
Methods inherited from Epuber::Compiler::Problem
caret_symbol, caret_symbols, formatted_match_line, remove_tabs, text_at, #to_s
Constructor Details
#initialize(match, message, file_path) ⇒ MatchProblem
Returns a new instance of MatchProblem.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/epuber/checker/text_checker.rb', line 17 def initialize(match, , file_path) whole_text = match.pre_match + match.matched_string + match.post_match line = match.pre_match_lines.count column = (match.pre_match_lines.last || '').length + 1 length = match.matched_string.length location = Epuber::Compiler::Problem::Location.new(line, column, length) super(:warn, , whole_text, location: location, file_path: file_path) end |