Class: Prismic::HtmlSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/prismic.rb

Overview

A class to override the default was to serialize HTML. Only needed if you want to override the default HTML serialization.

The html_serializer function is the recommended way to create an HtmlSerializer.

Instance Method Summary collapse

Constructor Details

#initialize(&blk) ⇒ HtmlSerializer

Returns a new instance of HtmlSerializer.



584
585
586
# File 'lib/prismic.rb', line 584

def initialize(&blk)
  @blk = blk
end

Instance Method Details

#serialize(element, content) ⇒ Object



588
589
590
# File 'lib/prismic.rb', line 588

def serialize(element, content)
  @blk.call(element, content)
end