Class: CKEditor5::Rails::Editor::Props
- Inherits:
-
Object
- Object
- CKEditor5::Rails::Editor::Props
- Defined in:
- lib/ckeditor5/rails/editor/props.rb
Constant Summary collapse
- EDITOR_TYPES =
{ classic: 'ClassicEditor', inline: 'InlineEditor', balloon: 'BalloonEditor', decoupled: 'DecoupledEditor', multiroot: 'MultiRootEditor' }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(controller_context, type, config, watchdog: true) ⇒ Props
constructor
A new instance of Props.
- #to_attributes ⇒ Object
Constructor Details
#initialize(controller_context, type, config, watchdog: true) ⇒ Props
Returns a new instance of Props.
15 16 17 18 19 20 21 22 |
# File 'lib/ckeditor5/rails/editor/props.rb', line 15 def initialize(controller_context, type, config, watchdog: true) raise ArgumentError, "Invalid editor type: #{type}" unless Props.valid_editor_type?(type) @controller_context = controller_context @watchdog = watchdog @type = type @config = config end |
Class Method Details
.valid_editor_type?(type) ⇒ Boolean
31 32 33 |
# File 'lib/ckeditor5/rails/editor/props.rb', line 31 def self.valid_editor_type?(type) EDITOR_TYPES.key?(type) end |
Instance Method Details
#to_attributes ⇒ Object
24 25 26 27 28 29 |
# File 'lib/ckeditor5/rails/editor/props.rb', line 24 def to_attributes { type: EDITOR_TYPES[@type], **serialized_attributes } end |