mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-29 21:39:24 +00:00
0458dc9b1f
interfaces.
24 lines
759 B
Plaintext
24 lines
759 B
Plaintext
ri--Ruby Interactive reference
|
|
|
|
ri displays descriptions of Ruby's built-in methods, classes, and
|
|
modules. Run "ri each_with_index" and you get:
|
|
|
|
--------------------------------------------------------
|
|
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}
|
|
|
|
Emacs interface by David Alan Black <dblack@candle.superlink.net> is
|
|
also bundled.
|
|
|
|
WWW: http://www.pragmaticprogrammer.com/ruby/downloads/ri.html
|
|
Author: The Pragmatic Programmers, LLC
|