Class: Primer::Forms::Dsl::SelectListInput
- Defined in:
- lib/primer/forms/dsl/select_list_input.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Option
Constant Summary
Constants inherited from Input
Input::DEFAULT_SIZE, Input::SIZE_MAPPINGS, Input::SIZE_OPTIONS, Input::SPACE_DELIMITED_ARIA_ATTRIBUTES
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes inherited from Input
#builder, #caption, #form, #ids, #input_arguments, #label_arguments, #validation_message
Instance Method Summary collapse
-
#focusable? ⇒ Boolean
:nocov:.
-
#initialize(name:, label:, **system_arguments) {|_self| ... } ⇒ SelectListInput
constructor
A new instance of SelectListInput.
- #option(**system_arguments) ⇒ Object
- #to_component ⇒ Object
-
#type ⇒ Object
:nocov:.
Methods inherited from Input
#add_input_aria, #add_input_classes, #add_input_data, #add_label_classes, #autofocus!, #caption?, #caption_id, #caption_template?, #disabled?, #full_width?, #hidden?, #input?, #invalid?, #merge_input_arguments!, #remove_input_data, #render_caption_template, #required?, #size, #valid?, #validation_id, #validation_messages
Methods included from ClassNameHelper
Constructor Details
#initialize(name:, label:, **system_arguments) {|_self| ... } ⇒ SelectListInput
Returns a new instance of SelectListInput.
21 22 23 24 25 26 27 28 29 |
# File 'lib/primer/forms/dsl/select_list_input.rb', line 21 def initialize(name:, label:, **system_arguments) @name = name @label = label = [] super(**system_arguments) yield(self) if block_given? end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
19 20 21 |
# File 'lib/primer/forms/dsl/select_list_input.rb', line 19 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'lib/primer/forms/dsl/select_list_input.rb', line 19 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
19 20 21 |
# File 'lib/primer/forms/dsl/select_list_input.rb', line 19 def end |
Instance Method Details
#focusable? ⇒ Boolean
:nocov:
46 47 48 |
# File 'lib/primer/forms/dsl/select_list_input.rb', line 46 def focusable? true end |
#option(**system_arguments) ⇒ Object
31 32 33 |
# File 'lib/primer/forms/dsl/select_list_input.rb', line 31 def option(**system_arguments) << Option.new(**system_arguments) end |
#to_component ⇒ Object
35 36 37 |
# File 'lib/primer/forms/dsl/select_list_input.rb', line 35 def to_component SelectList.new(input: self) end |
#type ⇒ Object
:nocov:
40 41 42 |
# File 'lib/primer/forms/dsl/select_list_input.rb', line 40 def type :select_list end |