From: Timothy Hunter Date: 2006-11-10T07:30:32+09:00 Subject: Re: Overwriting the Integer class for method succ! (instead of just succ) paul wrote: > Thanks all! I became so much wiser now. I gues I didn't find this > information googling, because I assumed that it would be possible, > therefore searching "ruby integer overwrite value" and such... > > Now I still wonder, the only source-code I found for the Integer class > was in C. From this I wasn't able to figure out how I would go IF i'd > like to write this count++ (and with that modifying all 1's to 2's > e.g.). > > This kind of information, is not in the Programming Ruby Built-in > Classes and Methods chapter. Is this because that only contains the > public methods, and not the protected's? Or are there no such thing as > protected's for Integer (because it's in C?)? > > Cheers again > > > I think it's because this behavior is considered to be part of Ruby's fundamental design. Changing this behavior requires deep knowledge of Ruby internals (and C programming) and is outside the scope of a book like Programming Ruby.