Ibraheem Ibz Umaru-Mohammed [mailto:iumarumo@btinternet.com] informs:
…
I usually just fire up the interpreter, and do something like:ibz@ignoramus:$ irb
Reading config file… done.
ruby-1.7.3 on i686-pc-linux with irb 0.9(02/07/03)
Type ‘help’ for more information.String.methods.sort
[“<”, “<=”, “<=>”, “==”, “===”, “=~”, “>”, “>=”, “id”,
“send”, “allocate”, “ancestors”, “become”, “class”,
“class_eval”, “class_variables”, “clone”, “const_defined?”,
“const_get”, “const_set”, “constants”, “display”, “dup”,
“eql?”, “equal?”, “extend”, “freeze”, “frozen?”, “hash”,
“id”, “include?”, “included_modules”, “inspect”,
“instance_eval”, “instance_method”, “instance_methods”,
“instance_of?”, “instance_variables”, “is_a?”, “kind_of?”,
“method”, “method_defined?”, “methods”, “module_eval”,
“name”, “new”, “nil?”, “private_class_method”,
“private_instance_methods”, “private_methods”,
“protected_instance_methods”, “protected_methods”,
“public_class_method”, “public_instance_methods”,
“public_methods”, “respond_to?”, “send”, “singleton_methods”,
“superclass”, “taint”, “tainted?”, “to_a”, “to_s”, “type”, “untaint”]Also, although you won’t be using the code above, you’ll find you’ve
forgotten a “=” and a “!” somewhere in there--ibz.
–
Hi Ibraheem,
I tried String.methods[40] n and got “to_a”.
Is it possible to do String.methods[40].man (or something like that) so that
it will output a manual-like page whose output is similar to ri’s
String.methods.to_a ?
many thanks -botp