Permalink
Browse files

README for github.

  • Loading branch information...
1 parent d8d39f8 commit c58647d57a2429bb78bcb078d105b458a656073a @bluefeet committed Apr 9, 2012
Showing with 68 additions and 0 deletions.
  1. +68 −0 README.pod
View
@@ -0,0 +1,68 @@
+=head1 NAME
+
+MooseX::Types::Data::Serializer - A Data::Serializer type library for Moose.
+
+=head1 SYNOPSIS
+
+ package MyClass;
+ use Moose;
+ use MooseX::Types::Data::Serializer;
+
+ has serializer => (
+ is => 'ro',
+ isa => 'Data::Serializer',
+ required => 1,
+ coerce => 1,
+ );
+
+ has raw_serializer => (
+ is => 'ro',
+ isa => 'Data::Serializer::Raw',
+ required => 1,
+ coerce => 1,
+ );
+
+ # String will be coerced in to a Data::Serializer object:
+ MyClass->new(
+ serializer => 'YAML',
+ raw_serializer => 'Storable',
+ );
+
+ # Hashref will be coerced as well:
+ MyClass->new(
+ serializer => { serializer => 'YAML', digester => 'MD5' },
+ raw_serializer => { serializer => 'Storable' },
+ );
+
+ use MooseX::Types::Data::Serializer qw( Serializer RawSerializer );
+
+=head1 DESCRIPTION
+
+This module provides L<Data::Serializer> types and coercians for L<Moose> attributes.
+
+Two standard Moose types are provided; Data::Serializer and Data::Serializer::Raw.
+In addition, two other MooseX::Types types are provided; Serializer and RawSerializer.
+
+See the L<MooseX::Types> documentation for details on how that works.
+
+=head1 TYPES
+
+=head2 Data::Serializer
+
+This is a standard Moose type that provides coercion from a string or a hashref. If
+a string is passed then it is used for the 'serializer' argumen to Data::Serializer->new().
+If a hashref is being coerced from then it will be de-referenced and used as the
+arguments to Data::Serializer->new().
+
+=head2 Data::Serializer::Raw
+
+This type works just like Data::Serializer, but for the L<Data::Serializer::Raw> module.
+
+=head2 Serializer
+
+This is a L<MooseX::Types> type that works just like the Data::Serializer type.
+
+=head2 RawSerializer
+
+Just like the Serializer type, but for Data::Serializer::Raw.
+

0 comments on commit c58647d

Please sign in to comment.