Class: Utopia::Project::ReleasesDocument::Summary
- Inherits:
-
Object
- Object
- Utopia::Project::ReleasesDocument::Summary
- Defined in:
- lib/utopia/project/releases_document.rb
Overview
Represents a section within a release.
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
The section heading node.
Instance Method Summary collapse
-
#id ⇒ Object
Generate the section identifier.
-
#initialize(node) ⇒ Summary
constructor
Initialize a release section summary.
-
#to_html ⇒ Object
Render the section heading contents as HTML.
-
#to_markdown ⇒ Object
Render the section heading contents as Markdown.
Constructor Details
#initialize(node) ⇒ Summary
Initialize a release section summary.
17 18 19 |
# File 'lib/utopia/project/releases_document.rb', line 17 def initialize(node) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
The section heading node.
23 24 25 |
# File 'lib/utopia/project/releases_document.rb', line 23 def node @node end |
Instance Method Details
#id ⇒ Object
Generate the section identifier.
27 28 29 |
# File 'lib/utopia/project/releases_document.rb', line 27 def id @node.to_plaintext.chomp.downcase.gsub(/\s+/, "-") end |
#to_html ⇒ Object
Render the section heading contents as HTML.
39 40 41 |
# File 'lib/utopia/project/releases_document.rb', line 39 def to_html @node.dup.extract_children.to_html end |
#to_markdown ⇒ Object
Render the section heading contents as Markdown.
33 34 35 |
# File 'lib/utopia/project/releases_document.rb', line 33 def to_markdown @node.dup.extract_children.to_markdown end |