Class: Primer::Forms::PrimerBaseComponentWrapper

Inherits:
BaseComponent show all
Includes:
ClassNameHelper
Defined in:
lib/primer/forms/primer_base_component_wrapper.rb

Overview

Wraps Primer::BaseComponent.

Instance Attribute Summary

Attributes included from ActsAsComponent

#template_root_path

Instance Method Summary collapse

Methods included from ClassNameHelper

#class_names

Methods inherited from BaseComponent

#content, inherited, #input?, #perform_render, #render?, #to_component, #type

Methods included from ActsAsComponent

#compile!, extended, #renders_templates

Constructor Details

#initialize(**system_arguments) ⇒ PrimerBaseComponentWrapper

Returns a new instance of PrimerBaseComponentWrapper.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/primer/forms/primer_base_component_wrapper.rb', line 9

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