Skip Menu |
 

This queue is for tickets about the MooseX-Storage CPAN distribution.

Report information
The Basics
Id: 77931
Status: open
Priority: 0/
Queue: MooseX-Storage

People
Owner: Nobody in particular
Requestors: yanick+cpan [...] babyl.dyndns.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Allow serialization of non-M::S-enabled sub-objects
Download (untitled) / with headers
text/plain 424b
A branch of MooseX::Storage that allows to serialize sub-objects even if they don't have a pack() method is at https://github.com/yanick/MooseX-Storage/tree/serialize-attribute The serialization is dealt with via a 'serializer' parameter given to the attribute, and the deserialization is done via the type's coercing, if available. See the test t/400-attribute_serialize.t for a complete demonstration. Joy, `/anick
Subject: Re: [rt.cpan.org #77931] Allow serialization of non-M::S-enabled sub-objects
Date: Wed, 20 Jun 2012 16:24:34 -0400
To: bug-MooseX-Storage [...] rt.cpan.org
From: Chris Prather <chris [...] prather.org>
On Wed, Jun 20, 2012 at 4:21 PM, Yanick Champoux via RT <bug-MooseX-Storage@rt.cpan.org> wrote: Show quoted text
> Wed Jun 20 16:21:50 2012: Request 77931 was acted upon. > Transaction: Ticket created by YANICK >       Queue: MooseX-Storage >     Subject: Allow serialization of non-M::S-enabled sub-objects >   Broken in: (no value) >    Severity: Wishlist >       Owner: Nobody >  Requestors: yanick+cpan@babyl.dyndns.org >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=77931 > > > > A branch of MooseX::Storage that allows to serialize sub-objects even if > they don't have a pac-k() method is at > https://github.com/yanick/MooseX-Storage/tree/serialize-attribute > > The serialization is dealt with via a 'serializer' parameter given to > the attribute, and the deserialization is done via the type's coercing, > if available. See the test t/400-attribute_serialize.t  for a complete > demonstration.
Can't this be done by registering custom Type handlers? See the docs in https://metacpan.org/module/MooseX::Storage::Engine for an example. -Chris
Download (untitled) / with headers
text/plain 299b
And only now do I realize that there is 'MooseX::Storage::Engine->add_custom_type_handler' which now takes care of that. Doh! I'll leave the ticket open, though, as my patch might have the benefit (or not, it's open to discussion) of localizing the serialization the specific attribute instances.
Download (untitled) / with headers
text/plain 236b
And in the vein of Chris showing me that the functionality was already implemented, a patch that mention MooseX::Storage::Engine from the main pod: https://github.com/yanick/MooseX-Storage/tree/custom-handler-doc `/. PS: MX::S rocks.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.