From: Jan Svitok Date: 2006-11-10T07:38:34+09:00 Subject: Re: Overwriting the Integer class for method succ! (instead of just succ) On 11/9/06, 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?)? If you know a bit of C, it's pretty interesting to read the ruby sources from time to time. They're very readble, and it's the definitive documentation after all ;-) The code for let say Array or Integer etc. is pretty easy (maybe some details are tough). You'll get the picture how the things are working on the inner side. There's even guide how to read them (in what order) ;-)