Class: Ariadne::Forms::Dsl::FormObject
- Inherits:
-
Object
- Object
- Ariadne::Forms::Dsl::FormObject
- Includes:
- InputMethods
- Defined in:
- lib/ariadne/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.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #button(**options, &block) ⇒ Object
- #group(**options, &block) ⇒ Object
-
#initialize(builder:, form:, id: ::Ariadne::ViewHelper.generate_id) {|_self| ... } ⇒ FormObject
constructor
A new instance of FormObject.
Methods included from InputMethods
#action_menu, #auto_complete, #check_box, #check_box_group, #clipboard_copy_button, #fields_for, #hidden, #inputs, #multi, #radio_button_group, #select_list, #separator, #status, #submit, #text_area, #text_field
Constructor Details
#initialize(builder:, form:, id: ::Ariadne::ViewHelper.generate_id) {|_self| ... } ⇒ FormObject
Returns a new instance of FormObject.
12 13 14 15 16 17 18 |
# File 'lib/ariadne/forms/dsl/form_object.rb', line 12 def initialize(builder:, form:, id: ::Ariadne::ViewHelper.generate_id) @builder = builder @form = form @id = id yield(self) if block_given? end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
10 11 12 |
# File 'lib/ariadne/forms/dsl/form_object.rb', line 10 def builder @builder end |
#form ⇒ Object (readonly)
Returns the value of attribute form.
10 11 12 |
# File 'lib/ariadne/forms/dsl/form_object.rb', line 10 def form @form end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/ariadne/forms/dsl/form_object.rb', line 10 def id @id end |
Instance Method Details
#button(**options, &block) ⇒ Object
24 25 26 |
# File 'lib/ariadne/forms/dsl/form_object.rb', line 24 def (**, &block) add_input(ButtonInput.new(builder: @builder, form: @form, **, &block)) end |
#group(**options, &block) ⇒ Object
20 21 22 |
# File 'lib/ariadne/forms/dsl/form_object.rb', line 20 def group(**, &block) add_input(InputGroup.new(builder: @builder, form: @form, **, &block)) end |