Class: Layouts::SettingsSectionComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Layouts::SettingsSectionComponent
- Defined in:
- app/components/layouts/settings_section_component.rb
Instance Method Summary collapse
-
#initialize(heading, description: nil, id: nil, testid: nil, options: {}) ⇒ SettingsSectionComponent
constructor
A new instance of SettingsSectionComponent.
- #options_attrs ⇒ Object
Constructor Details
#initialize(heading, description: nil, id: nil, testid: nil, options: {}) ⇒ SettingsSectionComponent
Returns a new instance of SettingsSectionComponent.
10 11 12 13 14 15 16 |
# File 'app/components/layouts/settings_section_component.rb', line 10 def initialize(heading, description: nil, id: nil, testid: nil, options: {}) @heading = heading @description = description @id = id @testid = testid = end |
Instance Method Details
#options_attrs ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/components/layouts/settings_section_component.rb', line 22 def data = [:data] || {} data[:testid] ||= @testid attrs = { class: [[:class]].flatten.compact, data: data } attrs[:id] = @id if @id .merge(attrs) end |