Skip to content

Instantly share code, notes, and snippets.

@xenoterracide
Created May 29, 2012 03:48
Show Gist options
  • Select an option

  • Save xenoterracide/2822416 to your computer and use it in GitHub Desktop.

Select an option

Save xenoterracide/2822416 to your computer and use it in GitHub Desktop.
MooseX::RemoteHelper example
package MessagePart {
use Moose 2;
use MooseX::RemoteHelper;
has array => (
remote_name => 'SomeColonDelimitedArray',
isa => 'ArrayRef',
is => 'ro',
serializer => sub {
my ( $attr, $instance ) = @_;
return join( ':', @{ $attr->get_value( $instance ) } );
},
);
__PACKAGE__->meta->make_immutable;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment