2015-04-26 12:48:37 +05:30
|
|
|
module Gitlab
|
|
|
|
module Diff
|
|
|
|
class Line
|
2016-01-29 22:53:50 +05:30
|
|
|
attr_reader :type, :index, :old_pos, :new_pos
|
|
|
|
attr_accessor :text
|
2015-04-26 12:48:37 +05:30
|
|
|
|
|
|
|
def initialize(text, type, index, old_pos, new_pos)
|
|
|
|
@text, @type, @index = text, type, index
|
|
|
|
@old_pos, @new_pos = old_pos, new_pos
|
|
|
|
end
|
2015-10-24 18:46:33 +05:30
|
|
|
|
|
|
|
def added?
|
|
|
|
type == 'new'
|
|
|
|
end
|
|
|
|
|
|
|
|
def removed?
|
|
|
|
type == 'old'
|
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|