I saw someone post a snippet of code that turned an object (with some
sort of “each” method) into an enumerable. It looked really neat, until
NoMethodError: undefined method `to_enum’ for “abcdef”:String
I looked it up and ri seems to think I have Object#to_enum. The
underlying code is c, so frankly, I don’t understand it. Even running
the examples from the documentation or looking at Object.new.methods, I
see nothing about this elusive method. Does anybody have any insight?
(I’m using ruby 1.8.6.)