Sha256: 193652f4a5b06d3b648116402741abd78646f423bfa8315bf5dffc9f22f01f11

Contents?: true

Size: 523 Bytes

Versions: 9

Compression:

Stored size: 523 Bytes

Contents

module Formalist
  module RichText
    module Rendering
      class EmbeddedFormRenderer
        attr_reader :container
        attr_reader :options

        def initialize(container = {}, **options)
          @container = container
          @options = options
        end

        def call(form_data)
          type, data = form_data.values_at(:name, :data)

          if container.key?(type)
            container[type].(data, options)
          else
            ""
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
formalist-0.6.0 lib/formalist/rich_text/rendering/embedded_form_renderer.rb
formalist-0.5.4 lib/formalist/rich_text/rendering/embedded_form_renderer.rb
formalist-0.5.3 lib/formalist/rich_text/rendering/embedded_form_renderer.rb
formalist-0.5.2 lib/formalist/rich_text/rendering/embedded_form_renderer.rb
formalist-0.5.1 lib/formalist/rich_text/rendering/embedded_form_renderer.rb
formalist-0.5.0 lib/formalist/rich_text/rendering/embedded_form_renderer.rb
formalist-0.4.2 lib/formalist/rich_text/rendering/embedded_form_renderer.rb
formalist-0.4.1 lib/formalist/rich_text/rendering/embedded_form_renderer.rb
formalist-0.4.0 lib/formalist/rich_text/rendering/embedded_form_renderer.rb