Class: RenderEditorjs::Blocks::Base

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper
Defined in:
lib/render_editorjs/blocks/base.rb

Direct Known Subclasses

Header, Image, List, Paragraph

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#output_bufferObject

ActionView::Helpers::TagHelper requires output_buffer accessor



14
15
16
# File 'lib/render_editorjs/blocks/base.rb', line 14

def output_buffer
  @output_buffer
end

#rawObject

ActionView::Helpers::TagHelper requires output_buffer accessor



14
15
16
# File 'lib/render_editorjs/blocks/base.rb', line 14

def raw
  @raw
end

Instance Method Details

#valid?(data) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/render_editorjs/blocks/base.rb', line 16

def valid?(data)
  validator(data).valid?
end

#validator(data) ⇒ Object



20
21
22
# File 'lib/render_editorjs/blocks/base.rb', line 20

def validator(data)
  Validator.new(data, self.class::SCHEMA)
end