~rgrjr/bookworm

2ca0f958b47696d6853a96fdb15a14be30dc98d8 — Bob Rogers 2 years ago 28e2e8a sort-content-1
Add method doc for books and locations

* Bookworm/Book.pm, Bookworm/Location.pm:
   + Add method documentation.
2 files changed, 31 insertions(+), 0 deletions(-)

M Bookworm/Book.pm
M Bookworm/Location.pm
M Bookworm/Book.pm => Bookworm/Book.pm +12 -0
@@ 439,6 439,12 @@ Synonym for the L</title> slot, to avoid ambiguity in C<web_update>.
Returns or sets the book category, e.g. fiction, biography.  This is
implemented as an enumeration in the schema and the user interface.

=head3 compare_authors_arrays

Given two arrayrefs of C<Bookworm::Author> instances, return -1, 0, or
1 to reflect their proper sort ort.  For sorting in the
C<Bookworm::Location> books table.

=head3 contained_item_class

Returns the string 'Bookworm::Authorship', which enables books to act


@@ 557,6 563,12 @@ Returns or sets the ID of the C<Bookworm::Publisher>.  Note that there
is no fetch accessor for the publisher, because we don't do much with
publishers.

=head3 search_date_string_field

Synonym for C<search_integer_field>.  This allows us to specify "At
least" and "At most" bounds for a string-valued field that happends to
represent a date.

=head3 title

Returns or sets the string that is the primary title of the book,

M Bookworm/Location.pm => Bookworm/Location.pm +19 -0
@@ 554,12 554,26 @@ books).

=head2 Accessors and methods

=head3 ajax_sort_content

Given a C<Bookworm::Location> and a C<ModGen::CGI> object, handles
AJAX requests to sort book or location content.

=head3 ancestor_of

Given another C<Bookworm::Location> object, returns true iff self
contains the other location.  This is used to prevent cycles by the
user interface that moves locations.

=head3 bg_color

Returns or sets a string that determines the background color of the
location name in most display contexts.  See the C<@background_colors>
array for allowed variables.  The special value "inherit" means to use
the location of our L</parent_location>, or no special background if
no ancestor specifies a color.  The L</backgroundify> method
implements the search.

=head3 book_children

Set fetch accessor that retrieves an arrayref of C<Bookworm::Book>


@@ 594,6 608,11 @@ usually used to describe the purpose of the location, since I tend to
create locations that are fine-grained enough to be self-describing,
e.g. "Somewhere >> home >> Bedroom >> BR Bookshelf >> BR BS #3".

=head3 display_info

Add the number of books (if we have any) to what the superclass method
provides, used as extra information on the Location Tree page.

=head3 fetch_root

Class method that fetches the "Somewhere" location.  Hierarchy browser