Class: GovukComponent::CookieBanner

Inherits:
Base
  • Object
show all
Defined in:
app/components/govuk_component/cookie_banner.rb

Instance Attribute Summary collapse

Attributes included from Traits::CustomHtmlAttributes

#html_attributes

Instance Method Summary collapse

Methods inherited from Base

wrap_slot

Methods included from Traits::CustomClasses

#classes

Constructor Details

#initialize(title: nil, aria_label: "Cookie banner", classes: [], html_attributes: {}) ⇒ CookieBanner

Returns a new instance of CookieBanner.



6
7
8
9
10
11
# File 'app/components/govuk_component/cookie_banner.rb', line 6

def initialize(title: nil, aria_label: "Cookie banner", classes: [], html_attributes: {})
  super(classes: classes, html_attributes: html_attributes)

  @title      = title
  @aria_label = aria_label
end

Instance Attribute Details

#aria_labelObject

Returns the value of attribute aria_label.



4
5
6
# File 'app/components/govuk_component/cookie_banner.rb', line 4

def aria_label
  @aria_label
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'app/components/govuk_component/cookie_banner.rb', line 4

def title
  @title
end