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 Also known as: to_str



14
15
16
# File 'lib/git/lint/reporters/line.rb', line 14

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