add hslice
[gitmo/Moose-Autobox.git] / examples / units / time.pl
index 7bb1fb0..2253565 100644 (file)
@@ -6,7 +6,8 @@ use warnings;
 use Moose::Autobox;
 
 {
-    package Units::Time;
+    package # hide me from PAUSE
+        Units::Time;
     use Moose::Role;
     use Moose::Autobox;
     
@@ -60,4 +61,33 @@ my $one_week_ago = 1->week->ago;
 print "1 day until 1 week ago   : " . 1->day->til($one_week_ago)->as_string;
 print "2 years since 1 week ago : " . 2->years->since($one_week_ago)->as_string;
 
+=pod
 
+=head1 NAME
+
+Unit::Time
+
+=head1 SYNOPSIS
+
+  Moose::Autobox->mixin_additional_role(SCALAR => 'Units::Time');
+  
+  print "2 days ago was           : " . 2->days->ago->as_string;
+  print "3 weeks from now will be : " . 3->weeks->from_now->as_string;
+  print "1 day until 1 week ago   : " . 1->day->til(1->week->ago)->as_string;
+  print "2 years since 1 week ago : " . 2->years->since(1->week->ago)->as_string;
+
+=head1 DESCRIPTION
+
+This is a Moose::Autobox port of the perl6 vmethods example.
+
+=head1 AUTHOR
+
+Stevan Little, E<lt>stevan@iinteractive.comE<gt>
+
+=head1 ACKNOLEDGEMENTS
+
+This code was ported from the version in the Pugs 
+examples/vmethods/ directory. See that for original author 
+information.
+
+=cut