Sha256: 22baa4fa97263d7515e4fae500aa6257aa95ec316d1724a30b6706e0a8537b37
Contents?: true
Size: 812 Bytes
Versions: 18
Compression:
Stored size: 812 Bytes
Contents
# frozen_string_literal: true module Primer # :nodoc: class FormComponents def self.from_input(input_klass) Class.new(Primer::Component) do @input_klass = input_klass class << self attr_reader :input_klass end def initialize(**system_arguments, &block) @system_arguments = system_arguments @block = block end def call builder = Primer::Forms::Builder.new( nil, nil, __vc_original_view_context, {} ) input = self.class.input_klass.new( builder: builder, form: nil, **@system_arguments, &@block ) input.to_component.render_in(__vc_original_view_context) { content } end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems