gitlab-org--gitlab-foss/lib/gitlab/diff/line.rb
2015-12-30 18:42:11 -05:00

21 lines
405 B
Ruby

module Gitlab
module Diff
class Line
attr_reader :type, :index, :old_pos, :new_pos
attr_accessor :text
def initialize(text, type, index, old_pos, new_pos)
@text, @type, @index = text, type, index
@old_pos, @new_pos = old_pos, new_pos
end
def added?
type == 'new'
end
def removed?
type == 'old'
end
end
end
end