Class: GovukComponent::Warning

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

Instance Attribute Summary

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(text:, icon_fallback_text: 'Warning', classes: [], html_attributes: {}) ⇒ Warning

Returns a new instance of Warning.



2
3
4
5
6
7
# File 'app/components/govuk_component/warning.rb', line 2

def initialize(text:, icon_fallback_text: 'Warning', classes: [], html_attributes: {})
  super(classes: classes, html_attributes: html_attributes)

  @text = text
  @icon_fallback_text = icon_fallback_text
end