Class: MetadataPresenter::PageWarning

Inherits:
Object
  • Object
show all
Defined in:
app/models/metadata_presenter/page_warning.rb

Instance Method Summary collapse

Constructor Details

#initialize(page:, main_flow_uuids:) ⇒ PageWarning

Returns a new instance of PageWarning.



3
4
5
6
# File 'app/models/metadata_presenter/page_warning.rb', line 3

def initialize(page:, main_flow_uuids:)
  @page = page
  @main_flow_uuids = main_flow_uuids
end

Instance Method Details

#detached?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/models/metadata_presenter/page_warning.rb', line 16

def detached?
  main_flow_uuids.exclude?(page&.uuid)
end

#missing?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/models/metadata_presenter/page_warning.rb', line 12

def missing?
  page.blank?
end

#show_warning?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/models/metadata_presenter/page_warning.rb', line 8

def show_warning?
  missing? || detached?
end