forked from dbalmain/ferret
-
Notifications
You must be signed in to change notification settings - Fork 11
/
DOCUMENTATION_STANDARDS
41 lines (40 loc) · 1.38 KB
/
DOCUMENTATION_STANDARDS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
These excellent documentation standards were taken from merb.
Every Ruby method should have documentation above the method definition that
fits this basic model...
# Render the specified item, with the specified options.
#
# ==== Parameters
# thing<String, Symbol, nil>::
# The thing to render. This will default to the current action
# opts<Hash>:: An options hash (see below)
#
# ==== Options (opts)
# :format<Symbol>:: A registered mime-type format
# :template<String>::
# The path to the template relative to the template root
# :status<~to_i>::
# The status to send to the client. Typically, this would
# be an integer (200), or a Merb status code (Accepted)
# :layout<~to_s>::
# A layout to use instead of the default. This should be
# relative to the layout root. By default, the layout will
# be either the controller_name or application. If you
# want to use an alternative content-type than the one
# that the base template was rendered as, you will need
# to do :layout => +foo.#{content_type}+ (i.e. +foo.json+)
#
# ==== Returns
# String:: The rendered template, including layout, if appropriate.
#
# ==== Raises
# TemplateNotFound::
# There is no template for the specified location.
#
# ==== Alternatives
# If you pass a Hash as the first parameter, it will be moved to
# opts and +thing+ will be the current action
#
# @public
def render(thing = nil, opts = {})
<snip>
end