class ContentBlockTools::ContentBlockReference

@return [String]
content_block_reference.embed_code #=> “{{embed:content_block_email_address:2b92cade-549c-4449-9796-e7a3957f3a86}}”
@example
The embed_code used for a block
@!attribute [r] embed_code
@return [String]
content_block_reference.id #=> “2b92cade-549c-4449-9796-e7a3957f3a86”
@example
The content UUID for a block
@!attribute [r] content_id
@api public
@return [String] the document type
content_block_reference.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
Defines a reference pointer for a Content Block

def find_all_in_document(document)

Returns:
  • (Array) - An array of content block references
def find_all_in_document(document)
  document.scan(ContentBlockReference::EMBED_REGEX).map do |match|
    ContentBlockReference.new(document_type: match[1], content_id: match[2], embed_code: match[0])
  end
end