diff options
author | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2011-12-01 17:55:09 +0000 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2011-12-05 18:26:10 +0000 |
commit | 43256f519bfeba10d6adc46af524ac513c8704a5 (patch) | |
tree | 3dd799e8dcedc5adde05313068a81c52ff0877a5 /lib/Data/MultiValued/AttributeTrait.pm | |
parent | Merge remote branch 'dzil-test/master' (diff) | |
download | data-multivalued-43256f519bfeba10d6adc46af524ac513c8704a5.tar.gz data-multivalued-43256f519bfeba10d6adc46af524ac513c8704a5.tar.bz2 data-multivalued-43256f519bfeba10d6adc46af524ac513c8704a5.zip |
use pod::weaver really
Diffstat (limited to 'lib/Data/MultiValued/AttributeTrait.pm')
-rw-r--r-- | lib/Data/MultiValued/AttributeTrait.pm | 62 |
1 files changed, 30 insertions, 32 deletions
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<Data::MultiValued::AttributeAccessors>) defines all the basic plumbing to glue C<Data::MultiValued::Tags> etc into Moose attributes. -=head1 Implementation details +=head2 Implementation details The multi-value object is stored in the instance slot named by the L</full_storage_slot> attribute attribute. C<before> modifiers on @@ -26,10 +26,10 @@ getters load the appropriate value from the multi-value object into the regular instance slot, C<after> 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<full_storage_slot> +=attr C<full_storage_slot> The instance slot to use to store the C<Data::MultiValued::Tags> 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<multi_accessor> +=attr C<multi_accessor> -=head2 C<multi_reader> +=attr C<multi_reader> -=head2 C<multi_writer> +=attr C<multi_writer> -=head2 C<multi_predicate> +=attr C<multi_predicate> -=head2 C<multi_clearer> +=attr C<multi_clearer> The names to use for the various additional accessors. See L<Class::MOP::Attribute> for details. These default to @@ -121,9 +121,7 @@ method of the multi-value object. requires 'opts_to_pass_get'; -=head1 METHODS - -=head2 C<slots> +=method C<slots> Adds the L</full_storage_slot> to the list of used slots. @@ -134,7 +132,7 @@ around slots => sub { return ($self->$orig(), $self->full_storage_slot); }; -=head2 C<set_full_storage> +=method C<set_full_storage> Stores a new instance of L</multivalue_storage_class> into the L</full_storage_slot> of the instance. @@ -153,7 +151,7 @@ sub set_full_storage { return $ret; } -=head2 C<get_full_storage> +=method C<get_full_storage> Retrieves the value of the L</full_storage_slot> of the instance. @@ -169,7 +167,7 @@ sub get_full_storage { ); } -=head2 C<full_storage> +=method C<full_storage> Returns an instance of L</multivalue_storage_class>, 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<accessor_metaclass> +=method C<accessor_metaclass> Makes sure that all accessors for this attribute are created via the L<Data::MultiValued::AttributeAccessors> method meta class. @@ -193,7 +191,7 @@ L<Data::MultiValued::AttributeAccessors> method meta class. sub accessor_metaclass { 'Data::MultiValued::AttributeAccessors' } -=head2 C<install_accessors> +=method C<install_accessors> After the regular L<Moose::Meta::Attribute> method, installs the multi-value accessors. @@ -246,7 +244,7 @@ sub _filter_opts { return \%ret; } -=head2 C<load_multi_value> +=method C<load_multi_value> 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<raw_clear_value> +=method C<raw_clear_value> Clears the instance slot. Does the same as L<Moose::Meta::Attribute/clear_value>, but we need this method because @@ -301,7 +299,7 @@ sub raw_clear_value { ); } -=head2 C<store_multi_value> +=method C<store_multi_value> 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<get_value> +=method C<get_value> Before the normal method, calls L</load_multi_value>. Normally, no options will be passed to the multi-value object C<get> method. @@ -333,7 +331,7 @@ before get_value => sub { $self->load_multi_value($instance,$dyn_opts); }; -=head2 C<get_multi_value> +=method C<get_multi_value> Sets the options that L</load_multi_value> will use, then calls L</get_value>. @@ -350,7 +348,7 @@ sub get_multi_value { return $self->get_value($instance); } -=head2 C<set_initial_value> +=method C<set_initial_value> After the normal method, calls L</store_multi_value>. @@ -362,9 +360,9 @@ after set_initial_value => sub { $self->store_multi_value($instance,$dyn_opts); }; -=head2 C<set_value> +=method C<set_value> -=head2 C<set_multi_value> +=method C<set_multi_value> Just like L</get_value> and L</get_multi_value>, but calling L</store_multi_value> after the regular C<set_value> @@ -385,9 +383,9 @@ sub set_multi_value { return $self->set_value($instance,$value); } -=head2 C<has_value> +=method C<has_value> -=head2 C<has_multi_value> +=method C<has_multi_value> Just like L</get_value> and L</get_multi_value>. @@ -407,9 +405,9 @@ sub has_multi_value { return $self->has_value($instance); } -=head2 C<clear_value> +=method C<clear_value> -=head2 C<clear_multi_value> +=method C<clear_multi_value> Call the C<clear> method on the multi-value object. @@ -430,9 +428,9 @@ sub clear_multi_value { return $self->clear_value($instance); } -=head2 C<get_multi_read_method> +=method C<get_multi_read_method> -=head2 C<get_multi_write_method> +=method C<get_multi_write_method> Return the name of the reader or writer method, honoring L</multi_reader>, L</multi_writer> and L</multi_accessor>. |