Class: Primer::Forms::SelectList
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Primer::Forms::SelectList
- Defined in:
- lib/primer/forms/select_list.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes included from ActsAsComponent
Instance Method Summary collapse
-
#initialize(input:) ⇒ SelectList
constructor
A new instance of SelectList.
- #options ⇒ Object
Methods inherited from BaseComponent
#content, inherited, #input?, #perform_render, #to_component, #type
Methods included from ActsAsComponent
#compile!, extended, #renders_templates
Methods included from ClassNameHelper
Constructor Details
#initialize(input:) ⇒ SelectList
Returns a new instance of SelectList.
9 10 11 12 13 14 15 16 17 |
# File 'lib/primer/forms/select_list.rb', line 9 def initialize(input:) @input = input @input.add_input_classes( "FormControl-select", "FormControl--medium" ) @field_wrap_classes = class_names("FormControl-select-wrap") end |
Instance Method Details
#options ⇒ Object
19 20 21 22 23 |
# File 'lib/primer/forms/select_list.rb', line 19 def ||= @input..map do |option| [option.label, option.value, option.system_arguments] end end |