Class: Propolize::ItemList
- Inherits:
-
BaseText
- Object
- DocumentComponent
- BaseText
- Propolize::ItemList
- Defined in:
- lib/propolize.rb
Overview
A list of list items
Instance Attribute Summary
Attributes inherited from BaseText
Instance Method Summary collapse
- #addItem(listItem) ⇒ Object
-
#initialize(options = {}) ⇒ ItemList
constructor
A new instance of ItemList.
- #to_s ⇒ Object
- #toHtml ⇒ Object
Methods inherited from BaseText
#critiqueClassHtml, #writeToDocument
Constructor Details
#initialize(options = {}) ⇒ ItemList
Returns a new instance of ItemList.
645 646 647 648 |
# File 'lib/propolize.rb', line 645 def initialize( = {}) @isCritique = [:isCritique] || false @items = [] end |
Instance Method Details
#addItem(listItem) ⇒ Object
650 651 652 653 |
# File 'lib/propolize.rb', line 650 def addItem(listItem) @items.push(listItem) listItem.list = self end |
#to_s ⇒ Object
655 656 657 |
# File 'lib/propolize.rb', line 655 def to_s return "ItemList: #{@items.inspect}" end |
#toHtml ⇒ Object
659 660 661 |
# File 'lib/propolize.rb', line 659 def toHtml return "<ul#{critiqueClassHtml}>\n#{@items.map(&:toHtml).join("\n")}\n</ul>" end |