Sha256: 0d2af7bb4846af4c5c573982a0fa1f643d809428f79121701ec04a0836f9ec82
Contents?: true
Size: 656 Bytes
Versions: 19
Compression:
Stored size: 656 Bytes
Contents
# frozen_string_literal: true require_relative 'props_base_plugin' module CKEditor5::Rails::Editor class PropsInlinePlugin < PropsBasePlugin attr_reader :code def initialize(name, code) super(name) @code = code validate_code! end def to_h { type: :inline, name: name, code: code } end private def validate_code! raise ArgumentError, 'Code must be a String' unless code.is_a?(String) return if code.include?('export default') raise ArgumentError, 'Code must include `export default` that exports plugin definition!' end end end
Version data entries
19 entries across 19 versions & 1 rubygems