Class: GovukComponent::SummaryListComponent::RowComponent
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::SummaryListComponent::RowComponent
- Defined in:
- app/components/govuk_component/summary_list_component/row_component.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#show_actions_column ⇒ Object
readonly
Returns the value of attribute show_actions_column.
-
#visually_hidden_action_suffix ⇒ Object
readonly
Returns the value of attribute visually_hidden_action_suffix.
-
#visually_hidden_text ⇒ Object
readonly
Returns the value of attribute visually_hidden_text.
Attributes inherited from Base
Instance Method Summary collapse
- #before_render ⇒ Object
- #call ⇒ Object
-
#initialize(show_actions_column: nil, visually_hidden_action_suffix: nil, classes: [], html_attributes: {}) ⇒ RowComponent
constructor
A new instance of RowComponent.
Methods inherited from Base
Constructor Details
#initialize(show_actions_column: nil, visually_hidden_action_suffix: nil, classes: [], html_attributes: {}) ⇒ RowComponent
Returns a new instance of RowComponent.
18 19 20 21 22 23 |
# File 'app/components/govuk_component/summary_list_component/row_component.rb', line 18 def initialize(show_actions_column: nil, visually_hidden_action_suffix: nil, classes: [], html_attributes: {}) @show_actions_column = show_actions_column @visually_hidden_action_suffix = visually_hidden_action_suffix super(classes:, html_attributes:) end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
2 3 4 |
# File 'app/components/govuk_component/summary_list_component/row_component.rb', line 2 def href @href end |
#show_actions_column ⇒ Object (readonly)
Returns the value of attribute show_actions_column.
2 3 4 |
# File 'app/components/govuk_component/summary_list_component/row_component.rb', line 2 def show_actions_column @show_actions_column end |
#visually_hidden_action_suffix ⇒ Object (readonly)
Returns the value of attribute visually_hidden_action_suffix.
2 3 4 |
# File 'app/components/govuk_component/summary_list_component/row_component.rb', line 2 def visually_hidden_action_suffix @visually_hidden_action_suffix end |
#visually_hidden_text ⇒ Object (readonly)
Returns the value of attribute visually_hidden_text.
2 3 4 |
# File 'app/components/govuk_component/summary_list_component/row_component.rb', line 2 def visually_hidden_text @visually_hidden_text end |
Instance Method Details
#before_render ⇒ Object
31 32 33 34 35 |
# File 'app/components/govuk_component/summary_list_component/row_component.rb', line 31 def before_render if show_actions_column && actions.none? html_attributes[:class] << no_actions_class end end |
#call ⇒ Object
25 26 27 28 29 |
# File 'app/components/govuk_component/summary_list_component/row_component.rb', line 25 def call tag.div(**html_attributes) do safe_join([key, value, actions_content]) end end |