慕姐8265434
有一个叫methods()的方法,比如Array.methods()--------------------------------------------------------- Object#methodsobj.methods => array------------------------------------------------------------------------Returns a list of the names of methods publicly accessible in_obj_. This will include all the methods accessible in _obj_'sancestors.class Klassdef kMethod()endendk = Klass.newk.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?","class", "instance_variable_set","methods", "extend", "<em>send</em>", "instance_eval"]k.methods.length #=> 42