class ContentBlockTools::ContentBlock
@return [String]
content_block_reference.embed_code #=> “{{embed:content_block_postal_address:2b92cade-549c-4449-9796-e7a3957f3a86/field_name}}”
content_block_reference.embed_code #=> “{{embed:content_block_email_address:2b92cade-549c-4449-9796-e7a3957f3a86}}”
@example
The embed_code used for a block containing optional field name
@!attribute [r] embed_code
@api public
@return [Hash] the details
content_block.details #=> { email_address: “foo@example.com” }
@example
A hash that contains the details of the content block
@!attribute [r] details
@api public
@return [String] the document type
content_block.document_type #=> “content_block_email_address”
@example
{ContentBlockTools::ContentBlockReference::SUPPORTED_DOCUMENT_TYPES}
will be used to render the content block. All supported document_types are documented in
The document type of the content block - this will be used to work out which Presenter
@!attribute [r] document_type
@api public
@return [String]
content_block.title #=> “Some title”
@example
A title for the content block
@!attribute [r] title
@return [String]
content_block.id #=> “2b92cade-549c-4449-9796-e7a3957f3a86”
@example
The content UUID for a block
@!attribute [r] content_id
@api public
Defines a Content Block
def details
def details to_h[:details].symbolize_keys end
def render
-
(string)- A HTML representation of the content block
def render CONTENT_PRESENTERS .fetch(document_type, Presenters::BasePresenter) .new(self).render end