Class: Propolize::Proposition
- Inherits:
-
DocumentComponent
- Object
- DocumentComponent
- Propolize::Proposition
- Defined in:
- lib/propolize.rb
Overview
A proposition (just the heading, without the explanation)
Instance Method Summary collapse
-
#initialize(text) ⇒ Proposition
constructor
A new instance of Proposition.
- #to_s ⇒ Object
- #toHtml ⇒ Object
-
#writeToDocument(document) ⇒ Object
write to document, by adding a proposition to the document (this will set state to :proposition if we were in the :intro, close any previous proposition, and start a new one).
Constructor Details
#initialize(text) ⇒ Proposition
Returns a new instance of Proposition.
579 580 581 |
# File 'lib/propolize.rb', line 579 def initialize(text) @text = text end |
Instance Method Details
#to_s ⇒ Object
583 584 585 |
# File 'lib/propolize.rb', line 583 def to_s return "Proposition: #{@text.inspect}" end |
#toHtml ⇒ Object
595 596 597 |
# File 'lib/propolize.rb', line 595 def toHtml return "<div class=\"proposition\">#{@document.processText(@text)}</div>" end |
#writeToDocument(document) ⇒ Object
write to document, by adding a proposition to the document (this will set state to :proposition if we were in the :intro, close any previous proposition, and start a new one)
590 591 592 593 |
# File 'lib/propolize.rb', line 590 def writeToDocument(document) document.addProposition(self) @document = document end |