Class: CKEditor5::Rails::Editor::PropsPlugin
- Inherits:
-
PropsBasePlugin
- Object
- PropsBasePlugin
- CKEditor5::Rails::Editor::PropsPlugin
- Defined in:
- lib/ckeditor5/rails/editor/props_plugin.rb
Instance Attribute Summary
Attributes inherited from PropsBasePlugin
Instance Method Summary collapse
-
#initialize(name, premium: false, **js_import_meta_attrs) ⇒ PropsPlugin
constructor
A new instance of PropsPlugin.
-
#to_h ⇒ Object
Compress a little bit default plugins to make output smaller.
Methods inherited from PropsBasePlugin
normalize, #preload_assets_bundle
Constructor Details
#initialize(name, premium: false, **js_import_meta_attrs) ⇒ PropsPlugin
Returns a new instance of PropsPlugin.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ckeditor5/rails/editor/props_plugin.rb', line 7 def initialize(name, premium: false, **) super(name) [:import_name] ||= if premium 'ckeditor5-premium-features' else 'ckeditor5' end @js_import_meta = ::CKEditor5::Rails::Assets::JSImportMeta.new( import_as: [:window_name] ? nil : name, ** ) end |
Instance Method Details
#to_h ⇒ Object
Compress a little bit default plugins to make output smaller
23 24 25 26 27 28 29 |
# File 'lib/ckeditor5/rails/editor/props_plugin.rb', line 23 def to_h if @js_import_meta.import_name == 'ckeditor5' @js_import_meta.import_as.to_s else @js_import_meta.to_h end end |