Class: MetadataPresenter::PageWarning
- Inherits:
-
Object
- Object
- MetadataPresenter::PageWarning
- Defined in:
- app/models/metadata_presenter/page_warning.rb
Instance Method Summary collapse
- #detached? ⇒ Boolean
-
#initialize(page:, main_flow_uuids:) ⇒ PageWarning
constructor
A new instance of PageWarning.
- #missing? ⇒ Boolean
- #show_warning? ⇒ Boolean
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
16 17 18 |
# File 'app/models/metadata_presenter/page_warning.rb', line 16 def detached? main_flow_uuids.exclude?(page&.uuid) end |
#missing? ⇒ Boolean
12 13 14 |
# File 'app/models/metadata_presenter/page_warning.rb', line 12 def missing? page.blank? end |
#show_warning? ⇒ Boolean
8 9 10 |
# File 'app/models/metadata_presenter/page_warning.rb', line 8 def show_warning? missing? || detached? end |