summaryrefslogtreecommitdiff
path: root/lib/gitlab/diff/line.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/diff/line.rb')
-rw-r--r--lib/gitlab/diff/line.rb13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb
index 70063071ee7..5b67cd46c48 100644
--- a/lib/gitlab/diff/line.rb
+++ b/lib/gitlab/diff/line.rb
@@ -3,9 +3,9 @@ module Gitlab
class Line
SERIALIZE_KEYS = %i(line_code rich_text text type index old_pos new_pos).freeze
- attr_reader :line_code, :type, :old_pos, :new_pos
+ attr_reader :line_code, :type, :index, :old_pos, :new_pos
attr_writer :rich_text
- attr_accessor :text, :index
+ attr_accessor :text
def initialize(text, type, index, old_pos, new_pos, parent_file: nil, line_code: nil, rich_text: nil)
@text, @type, @index = text, type, index
@@ -19,14 +19,7 @@ module Gitlab
end
def self.init_from_hash(hash)
- new(hash[:text],
- hash[:type],
- hash[:index],
- hash[:old_pos],
- hash[:new_pos],
- parent_file: hash[:parent_file],
- line_code: hash[:line_code],
- rich_text: hash[:rich_text])
+ new(hash[:text], hash[:type], hash[:index], hash[:old_pos], hash[:new_pos], line_code: hash[:line_code], rich_text: hash[:rich_text])
end
def to_hash