Class: Git::Lint::Reporters::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/git/lint/reporters/line.rb

Overview

Reports issues related to an invalid line within the commit body.

Constant Summary collapse

DEFAULT_INDENT =
"    "

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Line

Returns a new instance of Line.



10
11
12
# File 'lib/git/lint/reporters/line.rb', line 10

def initialize data = {}
  @data = data
end

Instance Method Details

#to_sObject



14
15
16
17
18
19
20
# File 'lib/git/lint/reporters/line.rb', line 14

def to_s
  if content.include? "\n"
    Lines::Paragraph.new(data).to_s
  else
    Lines::Sentence.new(data).to_s
  end
end