Is there a way to see the class specific methods available to an instance through IRB?
I made an instance of the URI class, and then pressed Tab to see what methods I can use, however I see about 100 possibilities:
1.9.3p286 :001 > require 'uri'
=> true
1.9.3p286 :002 > uri = URI('http://game.dl.a-steroids.com/TrafficServer/')
=> #<URI::HTTP:0x00000000eae390 URL:http://game.dl.a-steroids.com/TrafficServer/>
1.9.3p286 :008 > uri.
Display all 102 possibilities? (y or n)
I want to filter only the specific methods for that instance, such as the ones described here: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/uri/rdoc/URI.html or below:
1.9.3p286 :003 > uri.host
=> "game.dl.a-steroids.com"
1.9.3p286 :006 > uri.path
=> "/TrafficServer/"
1.9.3p286 :007 > uri.scheme
=> "http"
URIis a module. It cannot have an instance and it does not have instance methods. To see the module methods directly defined onURI, do:And what
URI(...)creates is an instance ofURI:HTTP. To see the instance methods directly defined onURI::HTTP, do this:If this seems too narrow, you can step up to a superclass.
URIclasses are based onURI::Generic,so do the same with it: