Rubric::Entry - a single entry made by a user
version 0.157
This class provides an interface to Rubric entries. It inherits from Rubric::DBI, which is a Class::DBI class.
This code is effectively abandonware. Although releases will sometimes be made to update contact info or to fix packaging flaws, bug reports will mostly be ignored. Feature requests are even more likely to be ignored. (If someone takes up maintenance of this code, they will presumably remove this notice.) This means that whatever version of perl is currently required is unlikely to change -- but also that it might change at any new maintainer's whim.
id - a unique identifier link - the link to which the entry refers username - the user who made the entry title - the title of the link's destination description - a short description of the entry body - a long body of text for the entry created - the time when the entry was first created modified - the time when the entry was last modified
The link attribute returns a Rubric::Link.
The uri attribute returns the URI of the entry's link.
The user attribute returns a Rubric::User.
Every entry has_many tags that describe it. The tags method will return the tags, and the entrytags method will return the Rubric::EntryTag objects that represent them.
tags
entrytags
This method returns a reference to an array of arrayrefs, each a (tag, count) pair for tags used on the week's 50 most recent entries.
The created and modified columns are stored as seconds since epoch, but inflated to Time::Piece objects.
The arguments to query provide a set of abstract constraints for the query. These are sent to Rubric::Entry::Query, which builds an SQL query and returns the result of running it. (Either a list or an Iterator is returned.)
query
(The built-in Class::DBI search method can't handle this kind of search.)
user - entries for this User tags - entries with these tags (arrayref) link - entries for this Link urimd5 - entries for the Link with this md5 sum has_body - whether entries must have bodies (T, F, or undef) has_link - whether entries must have a link (T, F, or undef) (time spec) - {created,modified}_{before,after,on} limits entries by time; given as a complete or partial time and date string in the form "YYYY-MM-DD HH:MM"
This method replaces all entry's current tags with the new set of tags.
my $tags = Rubric::Entry->tags_from_string($string);
This (class) method takes a string of tags, delimited by whitespace, and returns an array of the tags, throwing an exception if it finds invalid tags.
Valid tags (shouldn't this be documented somewhere else instead?) may contain letters, numbers, underscores, colons, dots, and asterisks. Hyphens me be used, but not as the first character.
markup
This method returns the value of the entry's @markup tag, or _default if there is no such tag.
_default
body_as
my $formatted_body = $entry->body_as("html");
This method returns the body of the entry, formatted into the given format. If the entry cannot be rendered into the given format, an exception is thrown.
Ricardo SIGNES <rjbs@semiotic.systems>
This software is copyright (c) 2004 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Rubric, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rubric
CPAN shell
perl -MCPAN -e shell install Rubric
For more information on module installation, please visit the detailed CPAN module installation guide.