Class: CKEditor5::Rails::Editor::PropsPlugin
- Inherits:
-
Object
- Object
- CKEditor5::Rails::Editor::PropsPlugin
- Defined in:
- lib/ckeditor5/rails/editor/props_plugin.rb
Instance Attribute Summary collapse
-
#js_import_meta ⇒ Object
readonly
Returns the value of attribute js_import_meta.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, premium: false, **js_import_meta) ⇒ PropsPlugin
constructor
A new instance of PropsPlugin.
- #to_h ⇒ Object
Constructor Details
#initialize(name, premium: false, **js_import_meta) ⇒ PropsPlugin
Returns a new instance of PropsPlugin.
9 10 11 12 13 14 15 16 |
# File 'lib/ckeditor5/rails/editor/props_plugin.rb', line 9 def initialize(name, premium: false, **) @name = name @js_import_meta = if .empty? { import_name: premium ? 'ckeditor5-premium-features' : 'ckeditor5' } else end end |
Instance Attribute Details
#js_import_meta ⇒ Object (readonly)
Returns the value of attribute js_import_meta.
5 6 7 |
# File 'lib/ckeditor5/rails/editor/props_plugin.rb', line 5 def @js_import_meta end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/ckeditor5/rails/editor/props_plugin.rb', line 5 def name @name end |
Class Method Details
.normalize(plugin) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/ckeditor5/rails/editor/props_plugin.rb', line 18 def self.normalize(plugin) case plugin when String, Symbol then new(plugin) when PropsPlugin, PropsInlinePlugin then plugin else raise ArgumentError, "Invalid plugin: #{plugin}" end end |