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

**URL:** <https://www.ruby-forum.com/t/find-all-the-methods-on-a-object-in-an-irb-session/80147>\
**Category:** Rails\
**Created:** [March 12, 2006, 10:19pm UTC](https://www.ruby-forum.com/t/find-all-the-methods-on-a-object-in-an-irb-session/80147 "2006-03-12T22:19:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 12, 2006, 10:19pm UTC](https://www.ruby-forum.com/t/find-all-the-methods-on-a-object-in-an-irb-session/80147/1 "2006-03-12T22:19:30Z")

</div>

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

Thanks,  
Joe

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 12, 2006, 10:34pm UTC](https://www.ruby-forum.com/t/find-all-the-methods-on-a-object-in-an-irb-session/80147/2 "2006-03-12T22:34:49Z")

</div>

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”, “[]”]

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 12, 2006, 10:34pm UTC](https://www.ruby-forum.com/t/find-all-the-methods-on-a-object-in-an-irb-session/80147/3 "2006-03-12T22:34:56Z")

</div>

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

an\_object.methods
