Sha256: 61ea850c0c79e3c096b61e116d1ebbd4ac06ffa7ceb2bf6cc112396c41ed82bc

Contents?: true

Size: 540 Bytes

Versions: 7

Compression:

Stored size: 540 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::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
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.70 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.69 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.68 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.67 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.66 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.65 lib/ariadne/forms/dsl/form_object.rb
ariadne_view_components-0.0.64 lib/ariadne/forms/dsl/form_object.rb