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 = Core::EMPTY_HASH) ⇒ Line

Returns a new instance of Line.



12
13
14
# File 'lib/git/lint/reporters/line.rb', line 12

def initialize data = Core::EMPTY_HASH
  @data = data
end

Instance Method Details

#to_sObject Also known as: to_str



16
17
18
# File 'lib/git/lint/reporters/line.rb', line 16

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