Class: Propolize::Heading
- Inherits:
-
DocumentComponent
- Object
- DocumentComponent
- Propolize::Heading
- Defined in:
- lib/propolize.rb
Overview
A secondary heading (which can appear in the appendix)
Instance Method Summary collapse
-
#initialize(text) ⇒ Heading
constructor
A new instance of Heading.
- #to_s ⇒ Object
- #toHtml ⇒ Object
-
#writeToDocument(document) ⇒ Object
write to document by adding a heading (which is only valid if we are in the appendix).
Constructor Details
#initialize(text) ⇒ Heading
Returns a new instance of Heading.
716 717 718 |
# File 'lib/propolize.rb', line 716 def initialize(text) @text = text end |
Instance Method Details
#to_s ⇒ Object
720 721 722 |
# File 'lib/propolize.rb', line 720 def to_s return "Heading: #{@text}" end |
#toHtml ⇒ Object
730 731 732 |
# File 'lib/propolize.rb', line 730 def toHtml return "<h2>#{@document.processText(@text)}</h2>" end |
#writeToDocument(document) ⇒ Object
write to document by adding a heading (which is only valid if we are in the appendix)
725 726 727 728 |
# File 'lib/propolize.rb', line 725 def writeToDocument(document) document.addHeading(self) @document = document end |