Class: GovukComponent::CookieBannerComponent
- Defined in:
- app/components/govuk_component/cookie_banner_component.rb
Defined Under Namespace
Classes: MessageComponent
Instance Attribute Summary collapse
-
#aria_label ⇒ Object
Returns the value of attribute aria_label.
-
#hidden ⇒ Object
Returns the value of attribute hidden.
-
#hide_in_print ⇒ Object
Returns the value of attribute hide_in_print.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(aria_label: config.default_cookie_banner_aria_label, hidden: false, hide_in_print: config.default_cookie_banner_hide_in_print, classes: [], html_attributes: {}) ⇒ CookieBannerComponent
constructor
A new instance of CookieBannerComponent.
Methods inherited from Base
Constructor Details
#initialize(aria_label: config.default_cookie_banner_aria_label, hidden: false, hide_in_print: config.default_cookie_banner_hide_in_print, classes: [], html_attributes: {}) ⇒ CookieBannerComponent
Returns a new instance of CookieBannerComponent.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/components/govuk_component/cookie_banner_component.rb', line 7 def initialize( aria_label: config., hidden: false, hide_in_print: config., classes: [], html_attributes: {} ) @aria_label = aria_label @hidden = hidden @hide_in_print = hide_in_print super(classes:, html_attributes:) end |
Instance Attribute Details
#aria_label ⇒ Object
Returns the value of attribute aria_label.
5 6 7 |
# File 'app/components/govuk_component/cookie_banner_component.rb', line 5 def aria_label @aria_label end |
#hidden ⇒ Object
Returns the value of attribute hidden.
5 6 7 |
# File 'app/components/govuk_component/cookie_banner_component.rb', line 5 def hidden @hidden end |
#hide_in_print ⇒ Object
Returns the value of attribute hide_in_print.
5 6 7 |
# File 'app/components/govuk_component/cookie_banner_component.rb', line 5 def hide_in_print @hide_in_print end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 |
# File 'app/components/govuk_component/cookie_banner_component.rb', line 21 def call tag.div(role: "region", aria: { label: aria_label }, data: { nosnippet: true }, hidden:, **html_attributes) do safe_join() end end |