Sha256: d662c0dd4ba62a88da127343a439f6290611e55be9118f8b9410d75b36566f7f

Contents?: true

Size: 708 Bytes

Versions: 30

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true

require "primer/class_name_helper"

module Primer
  module Forms
    # Wraps Primer::BaseComponent.
    class PrimerBaseComponentWrapper < BaseComponent
      include Primer::ClassNameHelper

      def initialize(**system_arguments)
        @system_arguments = system_arguments

        # Extract class and classes so they can be passed to Primer::BaseComponent
        # as classes:. The class: argument is expected by Rails, but Primer expects
        # classes:, reminiscent of HashWithIndifferentAccess shenanigans.
        @classes = class_names(
          system_arguments.delete(:classes),
          system_arguments.delete(:class)
        )
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.16.0 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.15.0 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.14.0 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.13.1 lib/primer/forms/primer_base_component_wrapper.rb
primer_view_components-0.13.2 lib/primer/forms/primer_base_component_wrapper.rb
primer_view_components-0.13.1 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.13.0 lib/primer/forms/primer_base_component_wrapper.rb
primer_view_components-0.13.0 lib/primer/forms/primer_base_component_wrapper.rb
primer_view_components-0.12.0 lib/primer/forms/primer_base_component_wrapper.rb
primer_view_components-0.11.0 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.12.1 lib/primer/forms/primer_base_component_wrapper.rb
primer_view_components-0.10.0 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.11.0 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.10.0 lib/primer/forms/primer_base_component_wrapper.rb
primer_view_components-0.9.0 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.9.1 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.9.0 lib/primer/forms/primer_base_component_wrapper.rb
openproject-primer_view_components-0.8.0 lib/primer/forms/primer_base_component_wrapper.rb
primer_view_components-0.8.0 lib/primer/forms/primer_base_component_wrapper.rb
primer_view_components-0.7.0 lib/primer/forms/primer_base_component_wrapper.rb