Sha256: e84c4a7073caa648c73ce70bb7ac63734f3038fa76615fc11f2e335024fcf12d

Contents?: true

Size: 636 Bytes

Versions: 15

Compression:

Stored size: 636 Bytes

Contents

# frozen_string_literal: true

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

        attr_reader :builder, :form, :text, :options

        def initialize(builder:, form:, text:, **options)
          @builder = builder
          @form = form
          @text = text
          @options = options

          yield(self) if block_given?
        end

        def to_component
          Ariadne::UI::Badge::Component.new(text: @text, **@options)
        end

        def type
          :group
        end

        def input?
          true
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.81 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.80.3 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.79.2 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.79.1 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.79 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.78 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.77 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.76.1 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.76 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.75 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.74.1 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.74 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.73 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.72 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.71 lib/ariadne/forms/dsl/badge.rb