Class: GovukComponent::TableComponent::ColGroupComponent::ColComponent

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

Instance Attribute Summary collapse

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Methods inherited from Base

#brand

Constructor Details

#initialize(span: 1, classes: [], html_attributes: {}) ⇒ ColComponent

Returns a new instance of ColComponent.



29
30
31
32
33
# File 'app/components/govuk_component/table_component/col_group_component.rb', line 29

def initialize(span: 1, classes: [], html_attributes: {})
  @span = span.to_s

  super(classes:, html_attributes:)
end

Instance Attribute Details

#spanObject (readonly)

Returns the value of attribute span.



27
28
29
# File 'app/components/govuk_component/table_component/col_group_component.rb', line 27

def span
  @span
end

Instance Method Details

#callObject



35
36
37
# File 'app/components/govuk_component/table_component/col_group_component.rb', line 35

def call
  tag.col(span:, **html_attributes)
end