ri stands for “Ruby Interactive” and provides documentation on Ruby itself and most gems. You access it from the command line.
Here are some samples:
ri Array
ri select
ri Hash#select
ri Array#select
ri ActiveRecord::Base
ri -l #lists all classes with ri docs
(If you want to access the RDoc documentation, there’s a tip for that, too: Easy Access to the API Docs for Gems.)
You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.