class ClosingComments::Source::Problem

Public Class Methods

new(entity, line) click to toggle source
# File lib/closing_comments/source.rb, line 67
def initialize(entity, line)
  @entity = entity
  @line = line
end

Public Instance Methods

column() click to toggle source
# File lib/closing_comments/source.rb, line 76
def column
  @line.index('end')
end
fix() click to toggle source
# File lib/closing_comments/source.rb, line 80
def fix
  @line[0...column] + @entity.ending
end
line() click to toggle source
# File lib/closing_comments/source.rb, line 72
def line
  @entity.last_line
end
message() click to toggle source
# File lib/closing_comments/source.rb, line 84
def message
  "missing #{@entity.entity} closing comment"
end
to_h() click to toggle source
# File lib/closing_comments/source.rb, line 88
def to_h
  {
    line: line,
    column: column,
    message: message,
  }
end