Class: GovukPublishingComponents::Presenters::EmergencyBannerHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/govuk_publishing_components/presenters/emergency_banner_helper.rb

Constant Summary collapse

EMERGENCY_TYPES =
%w[notable-death national-emergency local-emergency].freeze

Instance Method Summary collapse

Constructor Details

#initializeEmergencyBannerHelper

Returns a new instance of EmergencyBannerHelper.



6
# File 'lib/govuk_publishing_components/presenters/emergency_banner_helper.rb', line 6

def initialize; end

Instance Method Details

#emergency_typesObject



8
9
10
# File 'lib/govuk_publishing_components/presenters/emergency_banner_helper.rb', line 8

def emergency_types
  EMERGENCY_TYPES
end

#is_a_valid_emergency_type?(type) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/govuk_publishing_components/presenters/emergency_banner_helper.rb', line 12

def is_a_valid_emergency_type?(type)
  EMERGENCY_TYPES.include?(type)
end