Class: Prismic::Fragments::StructuredText::BlockGroup

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

Overview

Used during the call of #as_html : blocks are first gathered by groups, so that list items of the same list are placed within the same group, allowing to frame their serialization with

    ...
or
    ...
. Images, paragraphs, headings, embed, ... are then placed alone in their own BlockGroup.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind) ⇒ BlockGroup

Returns a new instance of BlockGroup.



12
13
14
15
# File 'lib/prismic/fragments/structured_text.rb', line 12

def initialize(kind)
  @kind = kind
  @blocks = []
end

Instance Attribute Details

#blocksObject (readonly)

Returns the value of attribute blocks.



11
12
13
# File 'lib/prismic/fragments/structured_text.rb', line 11

def blocks
  @blocks
end

#kindObject (readonly)

Returns the value of attribute kind.



11
12
13
# File 'lib/prismic/fragments/structured_text.rb', line 11

def kind
  @kind
end

Instance Method Details

#<<(block) ⇒ Object



16
17
18
# File 'lib/prismic/fragments/structured_text.rb', line 16

def <<(block)
  blocks << block
end