diff options
author | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2011-12-01 17:43:33 +0000 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2011-12-01 17:43:33 +0000 |
commit | 724178a6aed9efaa2ff66c1491fd7ac6c80c63de (patch) | |
tree | 0de11a86b039d4d4bd7de59503e270ea6c8d5d25 /lib/Data | |
parent | Build results of 6d60c5f (on master) (diff) | |
parent | Merge remote branch 'dzil-test/master' (diff) | |
download | data-multivalued-724178a6aed9efaa2ff66c1491fd7ac6c80c63de.tar.gz data-multivalued-724178a6aed9efaa2ff66c1491fd7ac6c80c63de.tar.bz2 data-multivalued-724178a6aed9efaa2ff66c1491fd7ac6c80c63de.zip |
Build results of 6d60c5f (on master)
Diffstat (limited to 'lib/Data')
-rw-r--r-- | lib/Data/MultiValued.pm | 6 | ||||
-rw-r--r-- | lib/Data/MultiValued/AttributeAccessors.pm | 2 | ||||
-rw-r--r-- | lib/Data/MultiValued/AttributeTrait.pm | 90 |
3 files changed, 51 insertions, 47 deletions
diff --git a/lib/Data/MultiValued.pm b/lib/Data/MultiValued.pm index 80ad5e6..c1f1681 100644 --- a/lib/Data/MultiValued.pm +++ b/lib/Data/MultiValued.pm @@ -70,11 +70,13 @@ module. Why use these? =item * -they are optimised for serialisation, see L<Data::MultiValued::UglySerializationHelperRole> and F<t/json.t>. +they are optimised for serialisation, see +L<Data::MultiValued::UglySerializationHelperRole> and F<t/json.t>. =item * -you get accessors generated for your Moose attributes just by setting a trait +you get accessors generated for your Moose attributes just by setting +a trait =item * diff --git a/lib/Data/MultiValued/AttributeAccessors.pm b/lib/Data/MultiValued/AttributeAccessors.pm index 695a943..63e9281 100644 --- a/lib/Data/MultiValued/AttributeAccessors.pm +++ b/lib/Data/MultiValued/AttributeAccessors.pm @@ -137,7 +137,7 @@ version 0.0.1_3 Subclass of L<Moose::Meta::Method::Accessor>, generates non-inlined (patches welcome) accessors for multi-valued attributes. -=head1 METHDOS +=head1 METHODS =head2 C<_instance_is_inlinable> diff --git a/lib/Data/MultiValued/AttributeTrait.pm b/lib/Data/MultiValued/AttributeTrait.pm index 87d4b69..0461dbf 100644 --- a/lib/Data/MultiValued/AttributeTrait.pm +++ b/lib/Data/MultiValued/AttributeTrait.pm @@ -300,28 +300,8 @@ 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 - -The multi-value object is stored in the instance slot named by the -L</full_storage_slot> attribute attribute. C<before> modifiers on -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 -These are the attributes that this trait adds to the attribute in -your class. Example: - - has stuff => ( - is => 'rw', - isa => 'Int', - traits => ['MultiValued::Tags'], - predicate => 'has_stuff', - multi_accessor => 'stuff_tagged', - multi_predicate => 'has_stuff_tagged', - ); - =head2 C<full_storage_slot> The instance slot to use to store the C<Data::MultiValued::Tags> or @@ -351,25 +331,6 @@ non-multi accessor. So, for example, will create a C<stuff> read / write accessor and a C<stuff_multi> read / write tagged accessor. -=head1 REQUIREMENTS - -These methods must be provided by any class consuming this role. See -L<Data::MultiValued::AttributeTrait::Tags> etc. for examples. - -=head2 C<multivalue_storage_class> - -The class to use to create the multi-value objects. - -=head2 C<opts_to_pass_set> - -Which options to pass from the multi-value accessors to the C<set> -method of the multi-value object. - -=head2 C<opts_to_pass_get> - -Which options to pass from the multi-value accessors to the C<get> -method of the multi-value object. - =head1 METHODS =head2 C<slots> @@ -472,11 +433,6 @@ Call the C<clear> method on the multi-value object. Return the name of the reader or writer method, honoring L</multi_reader>, L</multi_writer> and L</multi_accessor>. -=head1 Serialisation helpers - -These are used through -L<Data::MultiValued::UglySerializationHelperRole>. - =head2 C<_rebless_slot> Blesses the value inside the L</full_storage_slot> of the instance @@ -489,6 +445,52 @@ Returns the result of calling C<_as_hash> on the value inside the L</full_storage_slot> of the instance. Returns nothing if the slot does not have a value. +=head1 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 +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 + +These are the attributes that this trait adds to the attribute in +your class. Example: + + has stuff => ( + is => 'rw', + isa => 'Int', + traits => ['MultiValued::Tags'], + predicate => 'has_stuff', + multi_accessor => 'stuff_tagged', + multi_predicate => 'has_stuff_tagged', + ); + +=head1 REQUIREMENTS + +These methods must be provided by any class consuming this role. See +L<Data::MultiValued::AttributeTrait::Tags> etc. for examples. + +=head2 C<multivalue_storage_class> + +The class to use to create the multi-value objects. + +=head2 C<opts_to_pass_set> + +Which options to pass from the multi-value accessors to the C<set> +method of the multi-value object. + +=head2 C<opts_to_pass_get> + +Which options to pass from the multi-value accessors to the C<get> +method of the multi-value object. + +=head1 Serialisation helpers + +These are used through +L<Data::MultiValued::UglySerializationHelperRole>. + =head1 AUTHOR Gianni Ceccarelli <dakkar@thenautilus.net> |