Sha256: 41124e98e2d59cf9ef6d1b09c72a7a60ee6405e546352fe3e3b743c87342ab32

Contents?: true

Size: 637 Bytes

Versions: 5

Compression:

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

        def input?
          false
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.83.3 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.83.2 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.83.1 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.83 lib/ariadne/forms/dsl/badge.rb
ariadne_view_components-0.0.82 lib/ariadne/forms/dsl/badge.rb