Class: Gitlab::Diff::FileCollection::Compare
- Defined in:
- lib/gitlab/diff/file_collection/compare.rb
Instance Attribute Summary
Attributes inherited from Base
#diff_options, #diff_refs, #diffable, #fallback_diff_refs, #project
Instance Method Summary collapse
- #cache_key ⇒ Object
-
#initialize(compare, project:, diff_options:, diff_refs: nil) ⇒ Compare
constructor
A new instance of Compare.
- #unfold_diff_lines(positions) ⇒ Object
Methods inherited from Base
#clear_cache, default_options, #diff_file_paths, #diff_file_with_new_path, #diff_file_with_old_path, #diff_files, #diff_paths, #diffs, #overflow?, #pagination_data, #raw_diff_files, #unfold_diff_files, #write_cache
Constructor Details
#initialize(compare, project:, diff_options:, diff_refs: nil) ⇒ Compare
Returns a new instance of Compare.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gitlab/diff/file_collection/compare.rb', line 9 def initialize(compare, project:, diff_options:, diff_refs: nil) @pagination = Gitlab::PaginationDelegate.new( page: &.delete(:page), per_page: &.delete(:per_page), count: &.delete(:count) ) super(compare, project: project, diff_options: , diff_refs: diff_refs) end |
Instance Method Details
#cache_key ⇒ Object
26 27 28 |
# File 'lib/gitlab/diff/file_collection/compare.rb', line 26 def cache_key ['compare', @diffable.head.id, @diffable.base.id] end |
#unfold_diff_lines(positions) ⇒ Object
22 23 24 |
# File 'lib/gitlab/diff/file_collection/compare.rb', line 22 def unfold_diff_lines(positions) # no-op end |