In Files

  • rubygems/util/list.rb

Parent

Included Modules

Class/Module Index [+]

Quicksearch

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 6
def initialize(value = nil, tail = nil)
  @value = value
  @tail = tail
end
            
prepend(list, value) click to toggle source
 
               # File rubygems/util/list.rb, line 31
def self.prepend(list, value)
  return List.new(value) unless list
  List.new value, list
end
            

Public Instance Methods

each() click to toggle source
 
               # File rubygems/util/list.rb, line 11
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 23
def prepend(value)
  List.new value, self
end
            
to_a() click to toggle source
 
               # File rubygems/util/list.rb, line 19
def to_a
  super.reverse
end