Class: Gitlab::Diff::Formatters::FileFormatter
Instance Attribute Summary
#base_sha, #head_sha, #ignore_whitespace_change, #new_path, #old_path, #start_sha
Instance Method Summary
collapse
#to_h
Constructor Details
Returns a new instance of FileFormatter.
7
8
9
10
11
|
# File 'lib/gitlab/diff/formatters/file_formatter.rb', line 7
def initialize(attrs)
@ignore_whitespace_change = false
super(attrs)
end
|
Instance Method Details
#==(other) ⇒ Object
25
26
27
28
29
|
# File 'lib/gitlab/diff/formatters/file_formatter.rb', line 25
def ==(other)
other.is_a?(self.class) &&
old_path == other.old_path &&
new_path == other.new_path
end
|
#complete? ⇒ Boolean
21
22
23
|
# File 'lib/gitlab/diff/formatters/file_formatter.rb', line 21
def complete?
[new_path, old_path].all?(&:present?)
end
|
#key ⇒ Object
13
14
15
|
# File 'lib/gitlab/diff/formatters/file_formatter.rb', line 13
def key
@key ||= super.push(new_path, old_path)
end
|
#position_type ⇒ Object
17
18
19
|
# File 'lib/gitlab/diff/formatters/file_formatter.rb', line 17
def position_type
"file"
end
|