Class: Yattho::Forms::Dsl::CheckBoxGroupInput
- Defined in:
- lib/yattho/forms/dsl/check_box_group_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
-
#check_boxes ⇒ Object
readonly
Returns the value of attribute check_boxes.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Attributes inherited from Input
#builder, #caption, #form, #form_control, #ids, #input_arguments, #label_arguments, #validation_message
Instance Method Summary collapse
- #check_box(**system_arguments, &block) ⇒ Object
-
#initialize(name: nil, label: nil, **system_arguments) {|_self| ... } ⇒ CheckBoxGroupInput
constructor
A new instance of CheckBoxGroupInput.
- #name ⇒ Object
- #to_component ⇒ Object
- #type ⇒ 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!, #need_validation_element?, #remove_input_data, #render_caption_template, #required?, #size, #valid?, #validation_arguments, #validation_id, #validation_message_arguments, #validation_messages
Methods included from ClassNameHelper
Constructor Details
#initialize(name: nil, label: nil, **system_arguments) {|_self| ... } ⇒ CheckBoxGroupInput
Returns a new instance of CheckBoxGroupInput.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/yattho/forms/dsl/check_box_group_input.rb', line 10 def initialize(name: nil, label: nil, **system_arguments) @name = name @label = label @check_boxes = [] super(**system_arguments) add_label_classes("FormControl-label", "mb-2") yield(self) if block_given? end |
Instance Attribute Details
#check_boxes ⇒ Object (readonly)
Returns the value of attribute check_boxes.
8 9 10 |
# File 'lib/yattho/forms/dsl/check_box_group_input.rb', line 8 def check_boxes @check_boxes end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
8 9 10 |
# File 'lib/yattho/forms/dsl/check_box_group_input.rb', line 8 def label @label end |
Instance Method Details
#check_box(**system_arguments, &block) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/yattho/forms/dsl/check_box_group_input.rb', line 34 def check_box(**system_arguments, &block) args = { name: @name, **system_arguments, builder: @builder, form: @form, scheme: scheme } @check_boxes << CheckBoxInput.new(**args, &block) end |
#name ⇒ Object
26 27 28 |
# File 'lib/yattho/forms/dsl/check_box_group_input.rb', line 26 def name nil end |
#to_component ⇒ Object
22 23 24 |
# File 'lib/yattho/forms/dsl/check_box_group_input.rb', line 22 def to_component CheckBoxGroup.new(input: self) end |
#type ⇒ Object
30 31 32 |
# File 'lib/yattho/forms/dsl/check_box_group_input.rb', line 30 def type :check_box_group end |