Class: Danger::Suggester::Change

Inherits:
Object
  • Object
show all
Defined in:
lib/danger/suggester/change.rb

Instance Method Summary collapse

Constructor Details

#initialize(chunks) ⇒ Change


7
8
9
# File 'lib/danger/suggester/change.rb', line 7

def initialize(chunks)
  @chunks = chunks
end

Instance Method Details

#added_contentString


12
13
14
15
16
# File 'lib/danger/suggester/change.rb', line 12

def added_content
  added_lines.map do |line|
    line.content[1..-1]
  end.join("\n")
end

#first_line_numberInteger


19
20
21
# File 'lib/danger/suggester/change.rb', line 19

def first_line_number
  @chunks.first.line_number.left
end

#suggestible?Boolean


24
25
26
# File 'lib/danger/suggester/change.rb', line 24

def suggestible?
  deleted_lines.count == 1
end