In Files

  • rubygems/util/list.rb

Class/Module Index [+]

Quicksearch

Gem::List

Public Class Methods

prepend(list, value) click to toggle source
 
               # File rubygems/util/list.rb, line 43
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 5
def each
  n = self
  while n
    yield n.value
    n = n.tail
  end
end
            
find() click to toggle source
 
               # File rubygems/util/list.rb, line 24
def find
  n = self
  while n
    v = n.value
    return v if yield(v)
    n = n.tail
  end

  nil
end
            
prepend(value) click to toggle source
 
               # File rubygems/util/list.rb, line 35
def prepend(value)
  List.new value, self
end
            
to_a() click to toggle source
 
               # File rubygems/util/list.rb, line 13
def to_a
  ary = []
  n = self
  while n
    ary.unshift n.value
    n = n.tail
  end

  ary
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus