Sha256: d52c84e0ee8929867a848e334c063fb7e3d51923160c0f60870dd3c034246eda

Contents?: true

Size: 692 Bytes

Versions: 22

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

module Ariadne
  module Forms
    module Dsl
      # :nodoc:
      class FormObject
        include InputMethods

        attr_reader :builder, :form, :id

        def initialize(builder:, form:, id: ::Ariadne::ViewHelper.generate_id)
          @builder = builder
          @form = form
          @id = id

          yield(self) if block_given?
        end

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

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

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.93.2 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.93.1 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.93 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.92 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.91 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.90 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.89.1 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.89 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.88 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.87 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86.9 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86.8 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86.7 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86.6 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86.5 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86.4 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86.3 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86.2 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86.1 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.86 lib/ariadne/forms/dsl/form_object.rb