Where can I find first class documentation

If I use the Prime class as follows:

Prime.new 

I will get the following message:

 Prime::new is obsolete. use Prime::instance or class methods of Prime. 

I tried to find this class documentation, but could not.

+4
source share
2 answers

You must have it locally through ri :

 $ ri Prime = Prime < Object ------------------------------------------------------------------------------ = Includes: Enumerable (from ruby core) (from ruby core) ------------------------------------------------------------------------------ The set of all prime numbers. == Example Prime.each(100) do |prime| p prime #=> 2, 3, 5, 7, 11, ...., 97 end == Retrieving the instance Prime.new is obsolete. Now Prime has the default instance and you can access it as Prime.instance. ... 

There is also RubyDoc.info which has the best index:

http://rubydoc.info/stdlib/prime/1.9.2/frames

+2
source

Unfortunately, it has not yet been published on ruby-doc.org. But now you can look in the comment for the source code ; It includes usage examples.

+4
source

All Articles