Class: CKEditor5::Rails::Editor::EditableHeightNormalizer

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

Instance Method Summary collapse

Constructor Details

#initialize(editor_type) ⇒ EditableHeightNormalizer

Returns a new instance of EditableHeightNormalizer.



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

def initialize(editor_type)
  @editor_type = editor_type
end

Instance Method Details

#normalize(value) ⇒ Object



11
12
13
14
15
16
# File 'lib/ckeditor5/rails/editor/editable_height_normalizer.rb', line 11

def normalize(value)
  return nil if value.nil?

  validate_editor_type!
  convert_to_pixel_value(value)
end