Class: RapidDiffs::AppComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/rapid_diffs/app_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(presenter, extra_app_data: nil, extra_prefetch_endpoints: []) ⇒ AppComponent

Returns a new instance of AppComponent.



16
17
18
19
20
# File 'app/components/rapid_diffs/app_component.rb', line 16

def initialize(presenter, extra_app_data: nil, extra_prefetch_endpoints: [])
  @presenter = presenter
  @extra_app_data = extra_app_data
  @extra_prefetch_endpoints = extra_prefetch_endpoints
end

Instance Attribute Details

#presenterObject (readonly)

Returns the value of attribute presenter.



9
10
11
# File 'app/components/rapid_diffs/app_component.rb', line 9

def presenter
  @presenter
end

Instance Method Details

#diff_collectionObject



22
23
24
25
26
# File 'app/components/rapid_diffs/app_component.rb', line 22

def diff_collection
  return [linked_file] if linked_file

  diffs_slice || []
end