From: Andy Joel Date: 2008-07-19T07:15:07+09:00 Subject: Array.index with block not working Documentation from here: http://www.ruby-doc.org/core/classes/Array.html#M000290 _______ Returns the index of the first object in self such that is == to obj. If a block is given instead of an argument, returns first object for which block is true. Returns nil if no match is found. a = [ "a", "b", "c" ] a.index("b") #=> 1 a.index("z") #=> nil a.index{|x|x=="b"} #=> 1 This is an alias of find_index. _______ Typing the example into IRb gives an error after the fourth line: ArgumentError: wrong number of arguments (0 for 1) Why would that be? Am I missing something? Is the documentation wrong? What should I be doing? Ruby 1.8.6 by the way. -- Posted via http://www.ruby-forum.com/.