From: Dave Rolsky Date: Thu, 30 Sep 2010 14:14:47 +0000 (-0500) Subject: Some tweaks to documentation for Native.pm X-Git-Tag: 1.15~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66cce11c5c7d62d74b384b72c95abba20357a018;p=gitmo%2FMoose.git Some tweaks to documentation for Native.pm --- diff --git a/lib/Moose/Meta/Attribute/Native.pm b/lib/Moose/Meta/Attribute/Native.pm index 68854e6..ede20d7 100644 --- a/lib/Moose/Meta/Attribute/Native.pm +++ b/lib/Moose/Meta/Attribute/Native.pm @@ -95,43 +95,55 @@ allowed. Keys are method names that you want installed locally, and values are methods from the method providers (below). Currying with delegated methods works normally for C<< handles >>. -=head1 METHOD PROVIDERS +=head1 NATIVE TYPES =over -=item L +=item L -Common numerical operations. +Common methods for array references. - has 'integer' => ( - traits => ['Number'], + has 'queue' => ( + traits => ['Array'], is => 'ro', - isa => 'Int', - default => 5, + isa => 'ArrayRef[Str]', + default => sub { [] }, handles => { - set => 'set', - add => 'add', - sub => 'sub', - mul => 'mul', - div => 'div', - mod => 'mod', - abs => 'abs', + add_item => 'push', + next_item => 'shift', # ... } ); -=item L +=item L -Common methods for string operations. +Common methods for boolean values. - has 'text' => ( - traits => ['String'], + has 'is_lit' => ( + traits => ['Bool'], is => 'rw', - isa => 'Str', - default => q{}, + isa => 'Bool', + default => 0, handles => { - add_text => 'append', - replace_text => 'replace', + illuminate => 'set', + darken => 'unset', + flip_switch => 'toggle', + is_dark => 'not', + # ... + } + ); + +=item L + +Common methods for code references. + + has 'callback' => ( + traits => ['Code'], + is => 'ro', + isa => 'CodeRef', + default => sub { sub { 'called' } }, + handles => { + call => 'execute', # ... } ); @@ -153,24 +165,6 @@ Methods for incrementing and decrementing a counter attribute. } ); -=item L - -Common methods for boolean values. - - has 'is_lit' => ( - traits => ['Bool'], - is => 'rw', - isa => 'Bool', - default => 0, - handles => { - illuminate => 'set', - darken => 'unset', - flip_switch => 'toggle', - is_dark => 'not', - # ... - } - ); - =item L Common methods for hash references. @@ -188,33 +182,39 @@ Common methods for hash references. } ); -=item L +=item L -Common methods for array references. +Common numerical operations. - has 'queue' => ( - traits => ['Array'], + has 'integer' => ( + traits => ['Number'], is => 'ro', - isa => 'ArrayRef[Str]', - default => sub { [] }, + isa => 'Int', + default => 5, handles => { - add_item => 'push', - next_item => 'shift', + set => 'set', + add => 'add', + sub => 'sub', + mul => 'mul', + div => 'div', + mod => 'mod', + abs => 'abs', # ... } ); -=item L +=item L -Common methods for code references. +Common methods for string operations. - has 'callback' => ( - traits => ['Code'], - is => 'ro', - isa => 'CodeRef', - default => sub { sub { 'called' } }, + has 'text' => ( + traits => ['String'], + is => 'rw', + isa => 'Str', + default => q{}, handles => { - call => 'execute', + add_text => 'append', + replace_text => 'replace', # ... } );