A List of ListItems

Methods
#
A
E
L
N
P
Attributes
[R] items

Items in the list

[RW] type

The list's type

Class Public methods
new(type = nil, *items)

Creates a new list of type with items

# File ../ruby/lib/rdoc/markup/list.rb, line 19
def initialize type = nil, *items
  @type = type
  @items = []
  @items.push(*items)
end
Instance Public methods
<<(item)

Appends item to the list

# File ../ruby/lib/rdoc/markup/list.rb, line 28
def << item
  @items << item
end
accept(visitor)

Runs this list and all its items through visitor

# File ../ruby/lib/rdoc/markup/list.rb, line 41
def accept visitor
  visitor.accept_list_start self

  @items.each do |item|
    item.accept visitor
  end

  visitor.accept_list_end self
end
empty?()

Is the list empty?

# File ../ruby/lib/rdoc/markup/list.rb, line 54
def empty?
  @items.empty?
end
last()

Returns the last item in the list

# File ../ruby/lib/rdoc/markup/list.rb, line 61
def last
  @items.last
end
push(*items)

Appends items to the list

# File ../ruby/lib/rdoc/markup/list.rb, line 76
def push *items
  @items.push(*items)
end