0.02
[gitmo/MooseX-MetaDescription.git] / lib / MooseX / MetaDescription.pm
index e88653c..2695293 100644 (file)
@@ -1,7 +1,7 @@
 package MooseX::MetaDescription;
 use Moose;
 
-our $VERSION   = '0.01';
+our $VERSION   = '0.02';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use MooseX::MetaDescription::Meta::Class;
@@ -20,40 +20,40 @@ MooseX::MetaDescription - A framework for adding additional metadata to Moose cl
 
 =head1 SYNOPSIS
 
-    package Foo;
-    use metaclass 'MooseX::MetaDescription::Meta::Class' => (
-        # add class-level metadata
-        description => {
-            'Hello' => 'World'
-        }
-    );
-    use Moose;
-
-    has 'bar' => (
-        metaclass   => 'MooseX::MetaDescription::Meta::Attribute',
-        is          => 'ro',
-        isa         => 'Str',   
-        default     => sub { Bar->new() },
-        # add attribute level metadata
-        description => {
-            node_type   => 'element',
-        }
-    );
-
-    my $foo = Foo->new;
-    
-    $foo->meta->description; # { 'Hello' => 'World' }
-    
-    my $bar = $foo->meta->get_attribute('bar');
-    
-    # access the desciption HASH directly
-    $bar->description; # { node_type   => 'element' }    
-    
-    # or access the instance of MooseX::MetaDescription::Description
-    $bar->metadescription;
-    
-    # access the original attribute metaobject from the metadesc too
-    $bar->metadescription->descriptor == $bar;
+  package Foo;
+  use metaclass 'MooseX::MetaDescription::Meta::Class' => (
+      # add class-level metadata
+      description => {
+          'Hello' => 'World'
+      }
+  );
+  use Moose;
+  
+  has 'bar' => (
+      metaclass   => 'MooseX::MetaDescription::Meta::Attribute',
+      is          => 'ro',
+      isa         => 'Str',   
+      default     => sub { Bar->new() },
+      # add attribute level metadata
+      description => {
+          node_type   => 'element',
+      }
+  );
+  
+  my $foo = Foo->new;
+  
+  $foo->meta->description; # { 'Hello' => 'World' }
+  
+  my $bar = $foo->meta->get_attribute('bar');
+  
+  # access the desciption HASH directly
+  $bar->description; # { node_type   => 'element' }    
+  
+  # or access the instance of MooseX::MetaDescription::Description
+  $bar->metadescription;
+  
+  # access the original attribute metaobject from the metadesc too
+  $bar->metadescription->descriptor == $bar;
 
 =head1 DESCRIPTION
 
@@ -62,6 +62,16 @@ metadata to your Moose classes and attributes. This will allow
 you to track out of band data along with attributes, which is 
 very useful for say serializing Moose classes in HTML or XML.
 
+=head METHODS
+
+=over 4
+
+=item B<meta>
+
+The Moose metaclass.
+
+=back
+
 =head1 BUGS
 
 All complex software has bugs lurking in it, and this module is no