From: Robert Klemme Date: 2005-06-01T01:40:22+09:00 Subject: Re: Operation on Classes aartist wrote: > While learning ruby, I want to study from the perspective of classes. > > Exmaple: > Given: # Array, Index, Object > Operations: array[index] = obj -> obj > > Given: # Two Arrays > array & other_array -> an_array > array + other_array -> an_array > array - other_array -> an_array > array <=> other_array -> -1, 0, +1 > array == other_array -> bool > > Given: # Array, Object > array.push(obj) -> array > array << obj -> array > > etc.. > > So the idea is to know, what is possible with given objects of > different kind. > > Is there any way to generate it? There might be but I'd say it's not really worthwhile. The reason being that method signature and behavior can change at any time because anybody can override / change these methods at runtime. Why not just stick with the documentation? http://www.ruby-doc.org/ Kind regards robert