Class: Polaris::OptionList::SectionComponent
- Inherits:
-
Component
- Object
- Component
- Polaris::OptionList::SectionComponent
- Defined in:
- app/components/polaris/option_list/section_component.rb
Instance Method Summary collapse
-
#initialize(position: 0, title: nil, form: nil, attribute: nil, name: nil, selected: [], **system_arguments) ⇒ SectionComponent
constructor
A new instance of SectionComponent.
- #items ⇒ Object
- #system_arguments ⇒ Object
Constructor Details
#initialize(position: 0, title: nil, form: nil, attribute: nil, name: nil, selected: [], **system_arguments) ⇒ SectionComponent
Returns a new instance of SectionComponent.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/components/polaris/option_list/section_component.rb', line 24 def initialize( position: 0, title: nil, form: nil, attribute: nil, name: nil, selected: [], **system_arguments ) @position = position @title = title @form = form @attribute = attribute @name = name @selected = selected @system_arguments = system_arguments end |
Instance Method Details
#items ⇒ Object
48 49 50 |
# File 'app/components/polaris/option_list/section_component.rb', line 48 def items .presence || checkboxes.presence || end |
#system_arguments ⇒ Object
42 43 44 45 46 |
# File 'app/components/polaris/option_list/section_component.rb', line 42 def system_arguments @system_arguments.tap do |opts| opts[:tag] = "ul" end end |