Class: Coradoc::Markdown::Paragraph

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/markdown/model/paragraph.rb

Overview

Paragraph model representing a Markdown paragraph.

Examples:

Create a paragraph

para = Coradoc::Markdown::Paragraph.new(text: "Hello World")

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#serialize_content, #to_h, #to_md, visit, #visit

Constructor Details

#initialize(text: '', children: nil) ⇒ Paragraph

Returns a new instance of Paragraph.



17
18
19
20
21
# File 'lib/coradoc/markdown/model/paragraph.rb', line 17

def initialize(text: '', children: nil)
  super()
  @text = text
  @children = children || []
end

Instance Attribute Details

#childrenArray

Mixed content (strings and inline model objects)

Returns:

  • (Array)

    mixed content array



15
16
17
# File 'lib/coradoc/markdown/model/paragraph.rb', line 15

def children
  @children
end