Class: Yattho::Forms::Dsl::FormObject

Inherits:
Object
  • Object
show all
Includes:
InputMethods
Defined in:
lib/yattho/forms/dsl/form_object.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InputMethods

#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.

Yields:

  • (_self)

Yield Parameters:



12
13
14
15
16
17
# File 'lib/yattho/forms/dsl/form_object.rb', line 12

def initialize(builder:, form:)
  @builder = builder
  @form = form

  yield(self) if block_given?
end

Instance Attribute Details

#builderObject (readonly)

Returns the value of attribute builder.



10
11
12
# File 'lib/yattho/forms/dsl/form_object.rb', line 10

def builder
  @builder
end

#formObject (readonly)

Returns the value of attribute form.



10
11
12
# File 'lib/yattho/forms/dsl/form_object.rb', line 10

def form
  @form
end

Instance Method Details

#group(**options, &block) ⇒ Object



19
20
21
# File 'lib/yattho/forms/dsl/form_object.rb', line 19

def group(**options, &block)
  add_input InputGroup.new(builder: @builder, form: @form, **options, &block)
end