Sha256: 0a3c5b8379a3450056b460ef82d0769d2b62d94c0952398118bfdf8c52b7b2e3
Contents?: true
Size: 584 Bytes
Versions: 29
Compression:
Stored size: 584 Bytes
Contents
# frozen_string_literal: true module CKEditor5::Rails module Context class PresetSerializer def initialize(preset) @preset = preset end def to_attributes { plugins: serialize_plugins, config: serialize_config } end private delegate :config, to: :@preset def serialize_plugins (config[:plugins] || []).map { |plugin| Editor::PropsBasePlugin.normalize(plugin).to_h }.to_json end def serialize_config config.except(:plugins).to_json end end end end
Version data entries
29 entries across 29 versions & 2 rubygems