Class: GovukComponent::TableComponent::CaptionComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::TableComponent::CaptionComponent
- Defined in:
- app/components/govuk_component/table_component/caption_component.rb
Constant Summary collapse
- SIZES =
%w(s m l xl).freeze
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(text: nil, id: nil, size: 'm', classes: [], html_attributes: {}) ⇒ CaptionComponent
constructor
A new instance of CaptionComponent.
- #render? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(text: nil, id: nil, size: 'm', classes: [], html_attributes: {}) ⇒ CaptionComponent
Returns a new instance of CaptionComponent.
6 7 8 9 10 11 12 |
# File 'app/components/govuk_component/table_component/caption_component.rb', line 6 def initialize(text: nil, id: nil, size: 'm', classes: [], html_attributes: {}) @id = id @text = text @size = size super(classes:, html_attributes:) end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
2 3 4 |
# File 'app/components/govuk_component/table_component/caption_component.rb', line 2 def size @size end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
2 3 4 |
# File 'app/components/govuk_component/table_component/caption_component.rb', line 2 def text @text end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'app/components/govuk_component/table_component/caption_component.rb', line 14 def call tag.(, **html_attributes) end |
#render? ⇒ Boolean
18 19 20 |
# File 'app/components/govuk_component/table_component/caption_component.rb', line 18 def render? .present? end |