Class: Utopia::Project::ReleasesDocument::Summary

Inherits:
Object
  • Object
show all
Defined in:
lib/utopia/project/releases_document.rb

Overview

Represents a section within a release.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nodeObject (readonly)

The section heading node.



23
24
25
# File 'lib/utopia/project/releases_document.rb', line 23

def node
  @node
end

Instance Method Details

#idObject

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_htmlObject

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_markdownObject

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