class Gem::List

Attributes

tail[RW]
value[RW]

Public Class Methods

new(value = nil, tail = nil) click to toggle source
# File rubygems/util/list.rb, line 8
def initialize(value = nil, tail = nil)
  @value = value
  @tail = tail
end
prepend(list, value) click to toggle source
# File rubygems/util/list.rb, line 33
def self.prepend(list, value)
  return List.new(value) unless list
  List.new value, list
end

Public Instance Methods

each() { |value| ... } click to toggle source
# File rubygems/util/list.rb, line 13
def each
  n = self
  while n
    yield n.value
    n = n.tail
  end
end
prepend(value) click to toggle source
# File rubygems/util/list.rb, line 25
def prepend(value)
  List.new value, self
end
to_a() click to toggle source
Calls superclass method
# File rubygems/util/list.rb, line 21
def to_a
  super.reverse
end