Class: Primer::Forms::PrimerBaseComponentWrapper
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Primer::Forms::PrimerBaseComponentWrapper
- Includes:
- ClassNameHelper
- Defined in:
- app/lib/primer/forms/primer_base_component_wrapper.rb
Overview
Wraps Primer::BaseComponent.
Instance Method Summary collapse
-
#initialize(**system_arguments) ⇒ PrimerBaseComponentWrapper
constructor
A new instance of PrimerBaseComponentWrapper.
Methods included from ClassNameHelper
Methods inherited from BaseComponent
compile!, #content, #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 'app/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 |