Class: CKEditor5::Rails::Editor::PropsBasePlugin

Inherits:
Object
  • Object
show all
Defined in:
lib/ckeditor5/rails/editor/props_base_plugin.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ PropsBasePlugin

Returns a new instance of PropsBasePlugin.



7
8
9
# File 'lib/ckeditor5/rails/editor/props_base_plugin.rb', line 7

def initialize(name)
  @name = name
end

Instance Attribute Details

#assets_bundleObject (readonly)

Returns the value of attribute assets_bundle.



5
6
7
# File 'lib/ckeditor5/rails/editor/props_base_plugin.rb', line 5

def assets_bundle
  @assets_bundle
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/ckeditor5/rails/editor/props_base_plugin.rb', line 5

def name
  @name
end

Class Method Details

.normalize(plugin, **kwargs) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/ckeditor5/rails/editor/props_base_plugin.rb', line 19

def self.normalize(plugin, **kwargs)
  case plugin
  when String, Symbol then PropsPlugin.new(plugin, **kwargs)
  when PropsBasePlugin then plugin
  else raise ArgumentError, "Invalid plugin: #{plugin}"
  end
end

Instance Method Details

#preload_assets_bundleObject



11
12
13
# File 'lib/ckeditor5/rails/editor/props_base_plugin.rb', line 11

def preload_assets_bundle
  nil
end

#to_hObject

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/ckeditor5/rails/editor/props_base_plugin.rb', line 15

def to_h
  raise NotImplementedError, 'Method #to_h must be implemented in a subclass'
end