From f65d518a1c5d7092498a74ae52eb7b8a8ea2e789 Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Thu, 1 Dec 2011 17:55:09 +0000 Subject: use pod::weaver really --- lib/Data/MultiValued/AttributeAccessors.pm | 24 ++++----- lib/Data/MultiValued/AttributeTrait.pm | 62 +++++++++++----------- lib/Data/MultiValued/RangeContainer.pm | 10 ++-- lib/Data/MultiValued/Ranges.pm | 8 ++- lib/Data/MultiValued/TagContainer.pm | 12 ++--- lib/Data/MultiValued/TagContainerForRanges.pm | 4 +- lib/Data/MultiValued/Tags.pm | 8 ++- lib/Data/MultiValued/TagsAndRanges.pm | 8 ++- .../MultiValued/UglySerializationHelperRole.pm | 6 +-- 9 files changed, 62 insertions(+), 80 deletions(-) diff --git a/lib/Data/MultiValued/AttributeAccessors.pm b/lib/Data/MultiValued/AttributeAccessors.pm index 64063da..8480f98 100644 --- a/lib/Data/MultiValued/AttributeAccessors.pm +++ b/lib/Data/MultiValued/AttributeAccessors.pm @@ -11,9 +11,7 @@ use Carp 'confess'; Subclass of L, generates non-inlined (patches welcome) accessors for multi-valued attributes. -=head1 METHDOS - -=head2 C<_instance_is_inlinable> +=method C<_instance_is_inlinable> Returns C<0> to prevent attempts to inline the accessor methods. @@ -21,15 +19,15 @@ Returns C<0> to prevent attempts to inline the accessor methods. sub _instance_is_inlinable { 0 } -=head2 C<_generate_accessor_method> +=method C<_generate_accessor_method> -=head2 C<_generate_reader_method> +=method C<_generate_reader_method> -=head2 C<_generate_writer_method> +=method C<_generate_writer_method> -=head2 C<_generate_predicate_method> +=method C<_generate_predicate_method> -=head2 C<_generate_clearer_method> +=method C<_generate_clearer_method> Delegate to C, C, C, C, passing empty options @@ -87,15 +85,15 @@ sub _generate_clearer_method { }; } -=head2 C<_generate_multi_accessor_method> +=method C<_generate_multi_accessor_method> -=head2 C<_generate_multi_reader_method> +=method C<_generate_multi_reader_method> -=head2 C<_generate_multi_writer_method> +=method C<_generate_multi_writer_method> -=head2 C<_generate_multi_predicate_method> +=method C<_generate_multi_predicate_method> -=head2 C<_generate_multi_clearer_method> +=method C<_generate_multi_clearer_method> Delegate to C, C, C, C, passing C<$_[1]> as options diff --git a/lib/Data/MultiValued/AttributeTrait.pm b/lib/Data/MultiValued/AttributeTrait.pm index 263b6ee..78ae31e 100644 --- a/lib/Data/MultiValued/AttributeTrait.pm +++ b/lib/Data/MultiValued/AttributeTrait.pm @@ -18,7 +18,7 @@ This role (together with L) defines all the basic plumbing to glue C etc into Moose attributes. -=head1 Implementation details +=head2 Implementation details The multi-value object is stored in the instance slot named by the L attribute attribute. C modifiers on @@ -26,10 +26,10 @@ getters load the appropriate value from the multi-value object into the regular instance slot, C modifiers on setters store the value from the regular instance slot into the multi-value object. -=head1 ATTRIBUTES +=head2 Attributes -These are the attributes that this trait adds to the attribute in -your class. Example: +This trait adds some attributes to the attribute declarations in your +class. Example: has stuff => ( is => 'rw', @@ -40,7 +40,7 @@ your class. Example: multi_predicate => 'has_stuff_tagged', ); -=head2 C +=attr C The instance slot to use to store the C or similar object. Defaults to C<"${name}__MULTIVALUED_STORAGE__">, where @@ -55,15 +55,15 @@ has 'full_storage_slot' => ( ); sub _build_full_storage_slot { shift->name . '__MULTIVALUED_STORAGE__' } -=head2 C +=attr C -=head2 C +=attr C -=head2 C +=attr C -=head2 C +=attr C -=head2 C +=attr C The names to use for the various additional accessors. See L for details. These default to @@ -121,9 +121,7 @@ method of the multi-value object. requires 'opts_to_pass_get'; -=head1 METHODS - -=head2 C +=method C Adds the L to the list of used slots. @@ -134,7 +132,7 @@ around slots => sub { return ($self->$orig(), $self->full_storage_slot); }; -=head2 C +=method C Stores a new instance of L into the L of the instance. @@ -153,7 +151,7 @@ sub set_full_storage { return $ret; } -=head2 C +=method C Retrieves the value of the L of the instance. @@ -169,7 +167,7 @@ sub get_full_storage { ); } -=head2 C +=method C Returns an instance of L, either by retrieving it from the instance, or by creating one (and setting it in @@ -184,7 +182,7 @@ sub full_storage { || $self->set_full_storage($instance); } -=head2 C +=method C Makes sure that all accessors for this attribute are created via the L method meta class. @@ -193,7 +191,7 @@ L method meta class. sub accessor_metaclass { 'Data::MultiValued::AttributeAccessors' } -=head2 C +=method C After the regular L method, installs the multi-value accessors. @@ -246,7 +244,7 @@ sub _filter_opts { return \%ret; } -=head2 C +=method C Retrieves a value from the multi-value object, and stores it in the regular slot in the instance. If the value is not found, clears the @@ -283,7 +281,7 @@ sub load_multi_value { } } -=head2 C +=method C Clears the instance slot. Does the same as L, but we need this method because @@ -301,7 +299,7 @@ sub raw_clear_value { ); } -=head2 C +=method C Gets the value from the regular slot in the instance, and stores it into the multi-value object. @@ -320,7 +318,7 @@ sub store_multi_value { our $dyn_opts = {}; -=head2 C +=method C Before the normal method, calls L. Normally, no options will be passed to the multi-value object C method. @@ -333,7 +331,7 @@ before get_value => sub { $self->load_multi_value($instance,$dyn_opts); }; -=head2 C +=method C Sets the options that L will use, then calls L. @@ -350,7 +348,7 @@ sub get_multi_value { return $self->get_value($instance); } -=head2 C +=method C After the normal method, calls L. @@ -362,9 +360,9 @@ after set_initial_value => sub { $self->store_multi_value($instance,$dyn_opts); }; -=head2 C +=method C -=head2 C +=method C Just like L and L, but calling L after the regular C @@ -385,9 +383,9 @@ sub set_multi_value { return $self->set_value($instance,$value); } -=head2 C +=method C -=head2 C +=method C Just like L and L. @@ -407,9 +405,9 @@ sub has_multi_value { return $self->has_value($instance); } -=head2 C +=method C -=head2 C +=method C Call the C method on the multi-value object. @@ -430,9 +428,9 @@ sub clear_multi_value { return $self->clear_value($instance); } -=head2 C +=method C -=head2 C +=method C Return the name of the reader or writer method, honoring L, L and L. diff --git a/lib/Data/MultiValued/RangeContainer.pm b/lib/Data/MultiValued/RangeContainer.pm index a444150..8dd9933 100644 --- a/lib/Data/MultiValued/RangeContainer.pm +++ b/lib/Data/MultiValued/RangeContainer.pm @@ -22,8 +22,6 @@ infinity if used as C). The internal representation of a range is a hash with three keys, C C C. -=head1 METHODS - =cut has _storage => ( @@ -39,7 +37,7 @@ has _storage => ( default => sub { [ ] }, ); -=head2 C +=method C my $value = $obj->get({ at => $point }); @@ -117,7 +115,7 @@ sub _partition_slots { return \@before,\@overlap,\@after; } -=head2 C +=method C $obj->get_or_create({ from => $min, to => $max }); @@ -152,7 +150,7 @@ sub get_or_create { return $range; } -=head2 C +=method C $obj->clear({ from => $min, to => $max }); @@ -271,7 +269,7 @@ sub _splice_slot { return $new; } -=head2 C +=method C my @ranges = $obj->all_ranges; diff --git a/lib/Data/MultiValued/Ranges.pm b/lib/Data/MultiValued/Ranges.pm index 3da1594..aed29f4 100644 --- a/lib/Data/MultiValued/Ranges.pm +++ b/lib/Data/MultiValued/Ranges.pm @@ -21,8 +21,6 @@ use Data::MultiValued::RangeContainer; say $obj->get({at => 15}); # prints 'foo' say $obj->get({at => 35}); # dies -=head1 METHODS - =cut has _storage => ( @@ -36,7 +34,7 @@ sub _build__storage { Data::MultiValued::RangeContainer->new(); } -=head2 C +=method C $obj->set({ from => $min, to => $max, value => $the_value }); @@ -83,7 +81,7 @@ sub set { ->{value} = $args{value}; } -=head2 C +=method C my $value = $obj->get({ at => $point }); @@ -110,7 +108,7 @@ sub get { ->{value}; } -=head2 C +=method C $obj->clear({ from => $min, to => $max }); diff --git a/lib/Data/MultiValued/TagContainer.pm b/lib/Data/MultiValued/TagContainer.pm index f6e5551..fe1a794 100644 --- a/lib/Data/MultiValued/TagContainer.pm +++ b/lib/Data/MultiValued/TagContainer.pm @@ -20,8 +20,6 @@ tag that's not there. Data is kept in "storage cells", as created by L (by default, a hashref). -=head1 METHODS - =cut has _storage => ( @@ -46,7 +44,7 @@ has _default_tag => ( clearer => '_clear_default_tag', ); -=head2 C +=method C my $value = $obj->get({ tag => $the_tag }); @@ -82,7 +80,7 @@ sub get { return $self->_get_tag($tag); } -=head2 C +=method C $obj->get_or_create({ tag => $the_tag }); @@ -123,7 +121,7 @@ sub _clear_storage { $self->_storage({}); } -=head2 C +=method C $obj->clear({ tag => $the_tag }); @@ -151,14 +149,14 @@ sub clear { return; } -=head2 C +=method C my @tags = $obj->all_tags; Returns all the tags defined in this object. Does not return the C tag. -=head2 C<_create_new_inferior> +=method C<_create_new_inferior> Returns a new "storage cell", by default an empty hashref. See L for an example of use. diff --git a/lib/Data/MultiValued/TagContainerForRanges.pm b/lib/Data/MultiValued/TagContainerForRanges.pm index 826df9d..8e3c2b9 100644 --- a/lib/Data/MultiValued/TagContainerForRanges.pm +++ b/lib/Data/MultiValued/TagContainerForRanges.pm @@ -15,8 +15,6 @@ This module is a subclass of L, which only allows instances of L as "storage cells". -=head1 METHODS - =cut extends 'Data::MultiValued::TagContainer'; @@ -29,7 +27,7 @@ has '+_default_tag' => ( isa => class_type('Data::MultiValued::RangeContainer'), ); -=head2 C<_create_new_inferior> +=method C<_create_new_inferior> Returns a new L instance. diff --git a/lib/Data/MultiValued/Tags.pm b/lib/Data/MultiValued/Tags.pm index 59ebbf5..640db40 100644 --- a/lib/Data/MultiValued/Tags.pm +++ b/lib/Data/MultiValued/Tags.pm @@ -20,8 +20,6 @@ use Data::MultiValued::TagContainer; say $obj->get({tag=>'tag1'}); # prints 'a string' say $obj->get({tag=>'tag2'}); # dies -=head1 METHODS - =cut has _storage => ( @@ -35,7 +33,7 @@ sub _build__storage { Data::MultiValued::TagContainer->new(); } -=head2 C +=method C $obj->set({ tag => $the_tag, value => $the_value }); @@ -61,7 +59,7 @@ sub set { ->{value} = $args{value}; } -=head2 C +=method C my $value = $obj->get({ tag => $the_tag }); @@ -87,7 +85,7 @@ sub get { ->{value}; } -=head2 C +=method C $obj->clear({ tag => $the_tag }); diff --git a/lib/Data/MultiValued/TagsAndRanges.pm b/lib/Data/MultiValued/TagsAndRanges.pm index 60333c8..085b8c1 100644 --- a/lib/Data/MultiValued/TagsAndRanges.pm +++ b/lib/Data/MultiValued/TagsAndRanges.pm @@ -23,8 +23,6 @@ use Data::MultiValued::TagContainerForRanges; say $obj->get({tag => 'tag1', at => 35}); # dies say $obj->get({tag => 'tag2', at => 15}); # dies -=head1 METHODS - =cut has _storage => ( @@ -38,7 +36,7 @@ sub _build__storage { Data::MultiValued::TagContainerForRanges->new(); } -=head2 C +=method C $obj->set({ tag => $the_tag, from => $min, to => $max, value => $the_value }); @@ -64,7 +62,7 @@ sub set { ->{value} = $args{value}; } -=head2 C +=method C my $value = $obj->get({ tag => $the_tag, at => $point }); @@ -92,7 +90,7 @@ sub get { ->{value}; } -=head2 C +=method C $obj->clear({ tag => $the_tag, from => $min, to => $max }); diff --git a/lib/Data/MultiValued/UglySerializationHelperRole.pm b/lib/Data/MultiValued/UglySerializationHelperRole.pm index 0c06ac6..19f1268 100644 --- a/lib/Data/MultiValued/UglySerializationHelperRole.pm +++ b/lib/Data/MultiValued/UglySerializationHelperRole.pm @@ -42,9 +42,7 @@ copies. Oh, and on de-serialise it will skip all type constraint checking and bypass the accessors, so it may well give you an unusable object. -=head1 METHODS - -=head2 C +=method C my $obj = My::Class->new_in_place($hashref); @@ -69,7 +67,7 @@ sub new_in_place { return $self; } -=head2 C +=method C my $hashref = $obj->as_hash; -- cgit v1.2.3