Class: GovukComponent::NotificationBanner::Heading

Inherits:
ViewComponent::Slot
  • Object
show all
Defined in:
app/components/govuk_component/notification_banner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text: nil, link_text: nil, link_target: nil) ⇒ Heading

Returns a new instance of Heading.



39
40
41
42
43
# File 'app/components/govuk_component/notification_banner.rb', line 39

def initialize(text: nil, link_text: nil, link_target: nil)
  @text        = text
  @link_text   = link_text
  @link_target = link_target
end

Instance Attribute Details

Returns the value of attribute link_target.



37
38
39
# File 'app/components/govuk_component/notification_banner.rb', line 37

def link_target
  @link_target
end

Returns the value of attribute link_text.



37
38
39
# File 'app/components/govuk_component/notification_banner.rb', line 37

def link_text
  @link_text
end

#textObject

Returns the value of attribute text.



37
38
39
# File 'app/components/govuk_component/notification_banner.rb', line 37

def text
  @text
end

Instance Method Details

#default_classesObject



45
46
47
# File 'app/components/govuk_component/notification_banner.rb', line 45

def default_classes
  %w(govuk-notification-banner__heading)
end