class Epuber::Checker::TextChecker::MatchProblem

Public Class Methods

new(match, message, file_path) click to toggle source

@param message [String] @param file_path [String] @param match [MatchData]

Calls superclass method
# File lib/epuber/checker/text_checker.rb, line 17
def initialize(match, message, 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, message, whole_text, location: location, file_path: file_path)
end