From: Shawn M Moore Date: Tue, 10 Jun 2008 01:25:08 +0000 (+0000) Subject: Some doc updates X-Git-Tag: 0.04~80 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6caea456895ea69fd2a7307c8f56158d5d7cbcd0;p=gitmo%2FMouse.git Some doc updates --- diff --git a/lib/Mouse.pm b/lib/Mouse.pm index 37f92ca..ee5a823 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -99,7 +99,7 @@ __END__ =head1 NAME -Mouse - miniature Moose near the speed of light +Mouse - Moose minus antlers =head1 VERSION @@ -108,18 +108,28 @@ Version 0.01 released ??? =head1 SYNOPSIS package Point; + use Mouse; # automatically turns on strict and warnings + + has 'x' => (is => 'rw', isa => 'Int'); + has 'y' => (is => 'rw', isa => 'Int'); + + sub clear { + my $self = shift; + $self->x(0); + $self->y(0); + } + + package Point3D; use Mouse; - has x => ( - is => 'rw', - ); + extends 'Point'; - has y => ( - is => 'rw', - default => 0, - predicate => 'has_y', - clearer => 'clear_y', - ); + has 'z' => (is => 'rw', isa => 'Int'); + + #after 'clear' => sub { + # my $self = shift; + # $self->z(0); + #}; =head1 DESCRIPTION @@ -152,7 +162,7 @@ L for your convenience. =head2 import -Importing Mouse will set your class' superclass list to L. +Importing Mouse will default your class' superclass list to L. You may use L to replace the superclass list. =head2 unimport @@ -164,7 +174,7 @@ L) it will break loudly instead breaking subtly. =head2 load_class Class::Name -This will load a given Class::Name> (or die if it's not loadable). +This will load a given C (or die if it's not loadable). This function can be used in place of tricks like C or using C.