In Files

  • ruby-3.1.2/lib/rubygems/util/list.rb

Parent

Included Modules

Files

Class/Module Index [+]

Quicksearch

Gem::List

Attributes

tail[RW]
value[RW]

Public Class Methods

new(value = nil, tail = nil) click to toggle source
 
               # File ruby-3.1.2/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 ruby-3.1.2/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() click to toggle source
 
               # File ruby-3.1.2/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 ruby-3.1.2/lib/rubygems/util/list.rb, line 24
def prepend(value)
  List.new value, self
end
            
to_a() click to toggle source
 
               # File ruby-3.1.2/lib/rubygems/util/list.rb, line 20
def to_a
  super.reverse
end