I am new to ruby, and I have been reading a lot of tutorials. Yesterday I SWEAR I read an example of the each
statement (or something like it) that enumerated over an array, and then passed a subset of the array to the block. Here's an example, but the syntax is wrong (or I am using the wrong method) so this will not actually run.
arry = ["a", "b", "c", "d", "e"]
arry.each(3) {|a, b, c| puts a+b+c}
If I was using the right command, this would print:abc bcd cde
; it takes the first three members of the array starting at the index and the enumeration ends when there isn't a string long enough to provide all three arguments. I can't remember how to do it and I can't seem to google the right thing to find it. Do any of you guys know?