Class: GovukComponent::PhaseBannerComponent
- Defined in:
- app/components/govuk_component/phase_banner_component.rb
Instance Attribute Summary collapse
-
#phase_tag ⇒ Object
readonly
Returns the value of attribute phase_tag.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(tag: { text: config.default_phase_banner_tag }, text: config.default_phase_banner_text, classes: [], html_attributes: {}) ⇒ PhaseBannerComponent
constructor
A new instance of PhaseBannerComponent.
- #phase_tag_component ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(tag: { text: config.default_phase_banner_tag }, text: config.default_phase_banner_text, classes: [], html_attributes: {}) ⇒ PhaseBannerComponent
Returns a new instance of PhaseBannerComponent.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/components/govuk_component/phase_banner_component.rb', line 4 def initialize( tag: { text: config. }, text: config., classes: [], html_attributes: {} ) @phase_tag = tag @text = text super(classes:, html_attributes:) end |
Instance Attribute Details
#phase_tag ⇒ Object (readonly)
Returns the value of attribute phase_tag.
2 3 4 |
# File 'app/components/govuk_component/phase_banner_component.rb', line 2 def phase_tag @phase_tag end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
2 3 4 |
# File 'app/components/govuk_component/phase_banner_component.rb', line 2 def text @text end |
Instance Method Details
#phase_tag_component ⇒ Object
16 17 18 |
# File 'app/components/govuk_component/phase_banner_component.rb', line 16 def phase_tag_component GovukComponent::TagComponent.new(**phase_tag, classes: "#{brand}-phase-banner__content__tag") end |