new sysinstall

ibotty me at ibotty.net
Tue Sep 2 13:49:21 PDT 2003


5b@[128.113.24.47]> <20030902200639.GA1647 at xxxxxxxxxxxxxxxxx>
User-Agent: KNode/0.7.2
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
Lines: 29
NNTP-Posting-Host: 217.232.1.201
X-Trace: 1062535915 crater_reader.dragonflybsd.org 268 217.232.1.201
Xref: crater_reader.dragonflybsd.org dragonfly.kernel:899

> What's been going on with Ruby and where are the docs for the
> modules ? :)

you have ri [1], which is an interactive Reference.

(copied straight from 1:)

$ ri each_with_index
   --------------------------------------------------------
     enumObj.each_with_index {| obj, i | block }  -> nil
   --------------------------------------------------------

     Calls block with two arguments, the item and its index,
     for each item in enumObj.

        hash = Hash.new
        %w(cat dog wombat).each_with_index {|item, index|
          hash[item] = index
        }
        hash   #=> {"dog"=>1, "wombat"=>2, "cat"=>0}

this is a very good reference. it is not good for learning the language, but
there are at least two very good books online.

refs:
[1] http://www.pragmaticprogrammer.com/ruby/downloads/ri.html


~ibotty





More information about the Kernel mailing list