Class: GovukWebBanners::EmergencyBanner
- Inherits:
-
Object
- Object
- GovukWebBanners::EmergencyBanner
- Defined in:
- lib/govuk_web_banners/emergency_banner.rb
Instance Attribute Summary collapse
-
#campaign_class ⇒ Object
readonly
Returns the value of attribute campaign_class.
-
#heading ⇒ Object
readonly
Returns the value of attribute heading.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#link_text ⇒ Object
readonly
Returns the value of attribute link_text.
-
#short_description ⇒ Object
readonly
Returns the value of attribute short_description.
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize ⇒ EmergencyBanner
constructor
A new instance of EmergencyBanner.
Constructor Details
#initialize ⇒ EmergencyBanner
Returns a new instance of EmergencyBanner.
8 9 10 11 12 13 14 15 16 |
# File 'lib/govuk_web_banners/emergency_banner.rb', line 8 def initialize content = content_from_redis @campaign_class = content[:campaign_class].presence @heading = content[:heading].presence @short_description = content[:short_description].presence @link = content[:link].presence @link_text = content[:link_text].presence end |
Instance Attribute Details
#campaign_class ⇒ Object (readonly)
Returns the value of attribute campaign_class.
6 7 8 |
# File 'lib/govuk_web_banners/emergency_banner.rb', line 6 def campaign_class @campaign_class end |
#heading ⇒ Object (readonly)
Returns the value of attribute heading.
6 7 8 |
# File 'lib/govuk_web_banners/emergency_banner.rb', line 6 def heading @heading end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
6 7 8 |
# File 'lib/govuk_web_banners/emergency_banner.rb', line 6 def link @link end |
#link_text ⇒ Object (readonly)
Returns the value of attribute link_text.
6 7 8 |
# File 'lib/govuk_web_banners/emergency_banner.rb', line 6 def link_text @link_text end |
#short_description ⇒ Object (readonly)
Returns the value of attribute short_description.
6 7 8 |
# File 'lib/govuk_web_banners/emergency_banner.rb', line 6 def short_description @short_description end |
Instance Method Details
#active? ⇒ Boolean
18 19 20 |
# File 'lib/govuk_web_banners/emergency_banner.rb', line 18 def active? [campaign_class, heading].all? end |