Class: Propolize::Proposition

Inherits:
DocumentComponent show all
Defined in:
lib/propolize.rb

Overview

A proposition (just the heading, without the explanation)

Instance Method Summary collapse

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_sObject



583
584
585
# File 'lib/propolize.rb', line 583

def to_s
  return "Proposition: #{@text.inspect}"
end

#toHtmlObject



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