Method: Primer::Forms::Dsl::SelectInput#initialize

Defined in:
app/lib/primer/forms/dsl/select_input.rb

#initialize(name:, label:, **system_arguments) {|_self| ... } ⇒ SelectInput

Returns a new instance of SelectInput.

Yields:

  • (_self)

Yield Parameters:

[View source]

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/lib/primer/forms/dsl/select_input.rb', line 25

def initialize(name:, label:, **system_arguments)
  @name = name
  @label = label
  @options = []

  @select_arguments = {}.tap do |select_args|
    SELECT_ARGUMENTS.each do |select_arg|
      select_args[select_arg] = system_arguments.delete(select_arg)
    end
  end

  super(**system_arguments)

  yield(self) if block_given?
end