| WWW-FMyLife documentation | Contained in the WWW-FMyLife distribution. |
WWW::FMyLife::Item - Represents a single FMyLife.com Item
Version 0.04
my $fml = WWW::FMyLife::Item->new( {
author => 'me',
text => 'Stuff',
} );
...
Nothing.
Create a new item which can be submitted to FML.
Sawyer X (XSAWYERX), <xsawyerx at cpan.org>
Tamir Lousky (TLOUSKY), <tlousky at cpan.org>
Please report any bugs or feature requests to bug-www-fmylife at rt.cpan.org, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-FMyLife.
You can find documentation for this module with the perldoc command.
perldoc WWW::FMyLife
You can also look for information at:
Copyright 2010 Sawyer X, Tamir Lousky.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
| WWW-FMyLife documentation | Contained in the WWW-FMyLife distribution. |
package WWW::FMyLife::Item; use Moose; use Moose::Util::TypeConstraints; our $VERSION = '0.05'; subtype 'FMLAuthor' => as 'HashRef' => where { exists shift->{'content'} }; subtype 'FMLVote' => as 'HashRef' => where { my $ref = shift; ( exists $ref->{'deserved'} && exists $ref->{'agree'} ) && ( $ref->{'deserved'} =~ /^\d+$/ && $ref->{'agree'} =~ /^\d+$/ ) }; subtype 'EmptyComment' => as 'HashRef' => where { my $ref = shift; scalar keys %{$ref} == 0; }; has 'id' => ( is => 'rw', isa => 'Int' ); has 'author' => ( is => 'rw', isa => 'FMLAuthor' ); has 'date' => ( is => 'rw', isa => 'Str' ); has 'category' => ( is => 'rw', isa => 'Str' ); has 'text' => ( is => 'rw', isa => 'Str' ); has 'vote' => ( is => 'rw', isa => 'HashRef' ); has 'deserved' => ( is => 'rw', isa => 'Int' ); has 'agree' => ( is => 'rw', isa => 'Int' ); has 'comments' => ( is => 'rw', isa => 'Int|EmptyComment' ); has 'comments_flag' => ( is => 'rw', isa => 'Bool' ); no Moose; __PACKAGE__->meta->make_immutable; 1; __END__