RDoc::Markup::

ListItem

class

An item within a List that contains paragraphs, headings, etc.

For BULLET, NUMBER, LALPHA and UALPHA lists, the label will always be nil. For NOTE and LABEL lists, the list label may contain:

Attributes

label[RW]

The label for the ListItem

parts[R]

Parts of the ListItem

Public Class Methods

new(label = nil, *parts)

Creates a new ListItem with an optional label containing parts

# File lib/rdoc/markup/list_item.rb, line 26
def initialize label = nil, *parts
  @label = label
  @parts = []
  @parts.concat parts
end

Public Instance Methods

<<(part)

Appends part to the ListItem

# File lib/rdoc/markup/list_item.rb, line 35
def << part
  @parts << part
end
accept(visitor)

Runs this list item and all its parts through visitor

# File lib/rdoc/markup/list_item.rb, line 48
def accept visitor
  visitor.accept_list_item_start self

  @parts.each do |part|
    part.accept visitor
  end

  visitor.accept_list_item_end self
end
empty?()

Is the ListItem empty?

# File lib/rdoc/markup/list_item.rb, line 61
def empty?
  @parts.empty?
end
length()

Length of parts in the ListItem

# File lib/rdoc/markup/list_item.rb, line 68
def length
  @parts.length
end
push(*parts)

Adds parts to the ListItem

# File lib/rdoc/markup/list_item.rb, line 94
def push *parts
  @parts.concat parts
end