Class: Propolize::ListItem

Inherits:
Object
  • Object
show all
Defined in:
lib/propolize.rb

Overview

A list item (note: this is not a top-level component, rather it is part of an ItemList component)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ ListItem

Returns a new instance of ListItem.



625
626
627
628
# File 'lib/propolize.rb', line 625

def initialize(text)
  @text = text
  @list = nil
end

Instance Attribute Details

#listObject

Returns the value of attribute list.



623
624
625
# File 'lib/propolize.rb', line 623

def list
  @list
end

Instance Method Details

#documentObject



634
635
636
# File 'lib/propolize.rb', line 634

def document
  return list.document
end

#to_sObject



630
631
632
# File 'lib/propolize.rb', line 630

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

#toHtmlObject



638
639
640
# File 'lib/propolize.rb', line 638

def toHtml
  return "<li>#{document.processText(@text)}</li>"
end