Class: CKEditor5::Rails::Context::PresetBuilder

Inherits:
Object
  • Object
show all
Includes:
Presets::Concerns::ConfigurationMethods, Presets::Concerns::PluginMethods
Defined in:
lib/ckeditor5/rails/context/preset_builder.rb

Instance Method Summary collapse

Methods included from Presets::Concerns::PluginMethods

#external_plugin, #inline_plugin, #plugin, #plugins

Methods included from Presets::Concerns::ConfigurationMethods

#configure

Constructor Details

#initialize(&block) ⇒ PresetBuilder

Returns a new instance of PresetBuilder.



12
13
14
15
16
17
18
# File 'lib/ckeditor5/rails/context/preset_builder.rb', line 12

def initialize(&block)
  @config = {
    plugins: []
  }

  instance_eval(&block) if block_given?
end

Instance Method Details

#initialize_copy(source) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/ckeditor5/rails/context/preset_builder.rb', line 20

def initialize_copy(source)
  super

  @config = {
    plugins: source.config[:plugins].map(&:dup)
  }.merge(
    source.config.except(:plugins).deep_dup
  )
end