Sha256: e743158275f89ef406c7aeffaf004026efde7b73d964f1a0e04acf441570207d
Contents?: true
Size: 607 Bytes
Versions: 16
Compression:
Stored size: 607 Bytes
Contents
# frozen_string_literal: true module CKEditor5::Rails::Editor class PropsInlinePlugin attr_reader :name, :code def initialize(name, code) @name = 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
16 entries across 16 versions & 1 rubygems