Class: Primer::Forms::Dsl::ToggleSwitchInput
- Defined in:
- lib/primer/forms/dsl/toggle_switch_input.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Input
Input::DEFAULT_SIZE, Input::SIZE_MAPPINGS, Input::SIZE_OPTIONS, Input::SPACE_DELIMITED_ARIA_ATTRIBUTES
Instance Attribute Summary collapse
-
#csrf ⇒ Object
readonly
Returns the value of attribute csrf.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#src ⇒ Object
readonly
Returns the value of attribute src.
Attributes inherited from Input
#base_id, #builder, #caption, #form, #form_control, #ids, #input_arguments, #label_arguments, #validation_message
Instance Method Summary collapse
-
#initialize(name:, label:, src:, csrf: nil, **system_arguments) ⇒ ToggleSwitchInput
constructor
A new instance of ToggleSwitchInput.
- #to_component ⇒ Object
- #type ⇒ Object
- #validation_arguments ⇒ Object
Methods inherited from Input
#add_input_aria, #add_input_classes, #add_input_data, #add_label_classes, #autofocus!, #caption?, #caption_id, #caption_template?, #disabled?, #focusable?, #full_width?, #hidden?, #input?, #invalid?, #merge_input_arguments!, #remove_input_data, #render_caption_template, #required?, #size, #valid?, #validation_error_icon_target, #validation_id, #validation_message_arguments, #validation_messages, #validation_success_icon_target
Methods included from ClassNameHelper
Constructor Details
#initialize(name:, label:, src:, csrf: nil, **system_arguments) ⇒ ToggleSwitchInput
Returns a new instance of ToggleSwitchInput.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/primer/forms/dsl/toggle_switch_input.rb', line 10 def initialize( name:, label:, src:, csrf: nil, **system_arguments ) @name = name @label = label @src = src @csrf = csrf super(**system_arguments) end |
Instance Attribute Details
#csrf ⇒ Object (readonly)
Returns the value of attribute csrf.
8 9 10 |
# File 'lib/primer/forms/dsl/toggle_switch_input.rb', line 8 def csrf @csrf end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
8 9 10 |
# File 'lib/primer/forms/dsl/toggle_switch_input.rb', line 8 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/primer/forms/dsl/toggle_switch_input.rb', line 8 def name @name end |
#src ⇒ Object (readonly)
Returns the value of attribute src.
8 9 10 |
# File 'lib/primer/forms/dsl/toggle_switch_input.rb', line 8 def src @src end |
Instance Method Details
#to_component ⇒ Object
25 26 27 |
# File 'lib/primer/forms/dsl/toggle_switch_input.rb', line 25 def to_component ToggleSwitch.new(input: self) end |
#type ⇒ Object
29 30 31 |
# File 'lib/primer/forms/dsl/toggle_switch_input.rb', line 29 def type :toggle_switch end |
#validation_arguments ⇒ Object
33 34 35 |
# File 'lib/primer/forms/dsl/toggle_switch_input.rb', line 33 def validation_arguments super.merge(role: "alert") end |