class Gem::List

Attributes

tail[RW]
value[RW]

Public Class Methods

new(value = nil, tail = nil) click to toggle source
# File lib/rubygems/util/list.rb, line 7
def initialize(value = nil, tail = nil)
  @value = value
  @tail = tail
end
prepend(list, value) click to toggle source
# File lib/rubygems/util/list.rb, line 32
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 lib/rubygems/util/list.rb, line 12
def each
  n = self
  while n
    yield n.value
    n = n.tail
  end
end
prepend(value) click to toggle source
# File lib/rubygems/util/list.rb, line 24
def prepend(value)
  List.new value, self
end
to_a() click to toggle source
Calls superclass method Enumerable#to_a
# File lib/rubygems/util/list.rb, line 20
def to_a
  super.reverse
end