Class: Primer::Forms::Dsl::FormObject
- Inherits:
-
Object
- Object
- Primer::Forms::Dsl::FormObject
- Includes:
- InputMethods
- Defined in:
- app/lib/primer/forms/dsl/form_object.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#form ⇒ Object
readonly
Returns the value of attribute form.
Instance Method Summary collapse
- #group(**options, &block) ⇒ Object
-
#initialize(builder:, form:) {|_self| ... } ⇒ FormObject
constructor
A new instance of FormObject.
Methods included from InputMethods
#action_menu, #auto_complete, #button, #check_box, #check_box_group, #fields_for, #hidden, #inputs, #multi, #radio_button_group, #select_list, #separator, #submit, #text_area, #text_field
Constructor Details
#initialize(builder:, form:) {|_self| ... } ⇒ FormObject
Returns a new instance of FormObject.
12 13 14 15 16 17 |
# File 'app/lib/primer/forms/dsl/form_object.rb', line 12 def initialize(builder:, form:) @builder = builder @form = form yield(self) if block_given? end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
10 11 12 |
# File 'app/lib/primer/forms/dsl/form_object.rb', line 10 def builder @builder end |
#form ⇒ Object (readonly)
Returns the value of attribute form.
10 11 12 |
# File 'app/lib/primer/forms/dsl/form_object.rb', line 10 def form @form end |
Instance Method Details
#group(**options, &block) ⇒ Object
19 20 21 |
# File 'app/lib/primer/forms/dsl/form_object.rb', line 19 def group(**, &block) add_input InputGroup.new(builder: @builder, form: @form, **, &block) end |