Class: GovukComponent::SectionBreakComponent

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

Constant Summary collapse

SIZES =
%w(m l xl).freeze

Instance Attribute Summary

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Methods inherited from Base

#brand, #class_prefix

Constructor Details

#initialize(visible: config.default_section_break_visible, size: config.default_section_break_size, classes: [], html_attributes: {}) ⇒ SectionBreakComponent

Returns a new instance of SectionBreakComponent.



4
5
6
7
8
9
10
11
12
13
14
# File 'app/components/govuk_component/section_break_component.rb', line 4

def initialize(
  visible: config.default_section_break_visible,
  size: config.default_section_break_size,
  classes: [],
  html_attributes: {}
)
  @visible = visible
  @size    = size

  super(classes:, html_attributes:)
end

Instance Method Details

#callObject



16
17
18
# File 'app/components/govuk_component/section_break_component.rb', line 16

def call
  tag.hr(**html_attributes)
end