changed my nick in contribs section
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Manual / Reading.pod
CommitLineData
8457faf7 1
2=head1 NAME
3
4DBIx::Class::Manual::Reading - How to read and write DBIx::Class POD.
5
6=head1 DESCRIPTION
7
8This doc should help users to understand how the examples and
9documentation found in the L<DBIx::Class> distribution can be
10interpreted.
11
12Writers of DBIx::Class POD should also check here to make sure their
13additions are consistent with the rest of the documentation.
14
15=head1 METHODS
16
17Methods should be documented in the files which also contain the code
18for the method, or that file should be hidden from PAUSE completely,
19in which case the methods are documented in the file which loads
20it. Methods may also be documented and refered to in files
21representing the major objects or components on which they can be
22called.
23
24For example, L<DBIx::Class::Relationship> documents the methods
25actually coded in the helper relationship classes like
26DBIx::Class::Relationship::BelongsTo. The BelongsTo file itself is
27hidden from pause as it has no documentation. The accessors created by
28relationships should be mentioned in L<DBIx::Class::Row>, the major
29object that they will be called on.
30
31=head2 Method documentation
32
33=over
34
35=item *
36
37Each method starts with a "head2" statement of it's name.
38
39=item *
40
41The header is followed by a one-item list.
42
43The single item provides a list of all possible values for the
44arguments of the method in order, separated by C<, >, preceeded by the
45text "Arguments: "
46
47Example (for the belongs_to relationship):
48
49 =item Arguments: $accessor_name, $related_class, $fk_column|\%cond|\@cond?, \%attr?
50
51The following possible argument sigils can be shown:
52
53=over
54
55=item *
56
57$var - A scalar (string or numeric) variable.
58
59=item *
60
61\%var - A variable containing reference to a hash.
62
63=item *
64
65\@var - A variable containing a reference to an array.
66
67=item *
68
69\$var - A variable containing a reference to a scalar variable.
70
71=item *
72
73? - Optional, should be placed after the argument type and name.
74
75=item *
76
77| - Alternate argument types.
78
79=back
80
81NOTES:
82
83If several arguments are optional, it is always possible to pass
84C<undef> as one optional argument in order to skip it and provide a
85value for the following ones. This does not need to be indicated in
86the Arguments line, it is assumed.
87
88The C<?> for optional arguments always applies to the entire argument
89value, not a particular type or argument.
90
91=item *
92
93The argument list is followed by a single paragraph describing what
94the method does.
95
96=item *
97
98The description paragraph is followed by another list. Each item in
99the list explains one of the possible argument/type combinations.
100
101=item *
102
103The argument list is followed by some examples of how to use the
104method, using it's various types of arguments.
105
106The examples can also include ways to use the results if
107applicable. For instance if the documentation is for a relationship
108type, the examples can include how to call the resulting relation
109accessor, how to use the relation name in a search and so on.
110
111If some of the examples assume default values, these should be shown
112with and without the actual arguments, with hints about the equivalent
113calls.
114
115The example should be followed by one or more paragraphs explaining
116what it does.
117
118Examples and explaining paragraphs can be repeated as necessary.
119
120=back
121
122=head1 AUTHORS
123
124see L<DBIx::Class>
125
126=head1 LICENSE
127
128You may distribute this code under the same terms as Perl itself.
129
130=cut
131
132
133