Find all the methods on a object in an irb session?

How can I find all the methods on an object from withing irb?

Thanks,
Joe

Have you tried the “methods” method? E.g.:

irb(main):001:0> x = “test”
=> “test”
irb(main):002:0> x.methods
=> [“send”, “%”, “rindex”, “between?”, “reject”, “[]=”, “split”, “<<”,
“object_i
d”, “strip”, “size”, “singleton_methods”, “downcase”, “gsub!”, “count”,
“succ!”,
send”, “downcase!”, “intern”, “member?”, “squeeze!”, “equal?”,
“taint”, "*
", “next”, “find”, “frozen?”, “instance_variable_get”,
“each_with_index”,
“rstri
p!”, “each_line”, “+”, “kind_of?”, “sub”, “slice!”, “instance_eval”,
“require”,
“to_a”, “tr”, “replace”, “collect”, “reverse”, “all?”, “type”,
“entries”,
“lstri
p”, “protected_methods”, “capitalize”, “chop!”, “extend”, “capitalize!”,
“scan”,
“to_sym”, “detect”, “eql?”, “instance_variable_set”, “zip”,
“each_byte”,
"is_a?
", “casecmp”, “hash”, “gsub”, “empty?”, “to_str”, “map”, “to_s”, “tr_s”,
“any?”,
“tr!”, “class”, “match”, “sort”, “rstrip”, “tainted?”,
“private_methods”,
“next
!”, “swapcase”, “min”, “chomp!”, “require_gem_with_options”,
“swapcase!”,
"ljust
", “untaint”, “find_all”, “upto”, “hex”, “each”, “sum”, “id”,
“reverse!”,
“chop”
, “to_i”, “insert”, “<”, “inject”, “<=>”, “inspect”, “delete”, “dump”,
“==”,
“tr
_s!”, “unpack”, “>”, “concat”, “===”, “clone”, “succ”, “sort_by”,
“public_method
s”, “strip!”, “max”, “rjust”, “>=”, “respond_to?”, “display”, “freeze”,
“index”,
“select”, “<=”, “slice”, “oct”, “id”, “to_f”, “length”, “chomp”,
“methods”,
“upcase”, “partition”, “=~”, “sub!”, “squeeze”, “require_gem”,
“method”,
“upcas
e!”, “crypt”, “delete!”, “nil?”, “dup”, “grep”, “instance_variables”,
“lstrip!”,
“include?”, “instance_of?”, “center”, “[]”]

Just call the method “methods” on the object, i.e:

an_object.methods