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(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(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 |
# File 'app/components/polaris/option_list/section_component.rb', line 24 def initialize( title: nil, form: nil, attribute: nil, name: nil, selected: [], **system_arguments ) @title = title @form = form @attribute = attribute @name = name @selected = selected @system_arguments = system_arguments end |
Instance Method Details
#items ⇒ Object
50 51 52 |
# File 'app/components/polaris/option_list/section_component.rb', line 50 def items .presence || checkboxes.presence || end |
#system_arguments ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'app/components/polaris/option_list/section_component.rb', line 40 def system_arguments @system_arguments.tap do |opts| opts[:tag] = "ul" opts[:classes] = class_names( @system_arguments[:classes], "Polaris-OptionList__Options" ) end end |