Rdoc
A cheatsheet by @rstacruz|Refreshed 7 months ago.Refresh|View source on Github

Basic RDoc format

Basic RDoc format

# Foo.
#
# @example
#
#   y
#   g
#
# @param [String] param_name The xx and xx.
#
# @see https://example.com/
#
# @return [true] if so

Inline

Inline

*bold*
_emphasized_
+code+
https://www.example.com/
See Models::User@Examples
{Google}[https://google.com/]

Definition lists

Definition lists

# == Definition lists
#
# list::  hi.
# +foo+:: parameterized
# == Definition lists
# [foo]   also
# [bar]   like this

Return types

Return types

# @return [String]
# @return [String, nil] the name

Callseq

Callseq

# :call-seq:
#   ARGF.readlines(sep=$/)     -> array
#   ARGF.readlines(limit)      -> array
#   ARGF.readlines(sep, limit) -> array
#
#   ARGF.to_a(sep=$/)     -> array
#   ARGF.to_a(limit)      -> array
#   ARGF.to_a(sep, limit) -> array

Category

Category

# :category: Utilities

Sections

Sections

# :section: Expiry methods
# methods relating to expiring

def expire!
def expired?
...

Using tomdoc

Using tomdoc

# :markup: TomDoc

Place this at the beginning of the file.