[Bps-public-commit] UNNAMED PROJECT branch, master, updated. 7852bd21ba06b07ba499aeb7c443bf0c712fb5e2

sartak at bestpractical.com sartak at bestpractical.com
Mon Feb 23 21:58:44 EST 2009


The branch, master has been updated
       via  7852bd21ba06b07ba499aeb7c443bf0c712fb5e2 (commit)
      from  f216c9288a09d4da55e82dbba3022cdd513a6a24 (commit)

Summary of changes:
 lib/Path/Dispatcher/Rule/Metadata.pm |   38 ++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 7852bd21ba06b07ba499aeb7c443bf0c712fb5e2
Author: Shawn M Moore <sartak at gmail.com>
Date:   Mon Feb 23 21:58:38 2009 -0500

    Doc for Metadata rule

diff --git a/lib/Path/Dispatcher/Rule/Metadata.pm b/lib/Path/Dispatcher/Rule/Metadata.pm
index fc67e9f..357ceff 100644
--- a/lib/Path/Dispatcher/Rule/Metadata.pm
+++ b/lib/Path/Dispatcher/Rule/Metadata.pm
@@ -38,3 +38,41 @@ no Any::Moose;
 
 1;
 
+__END__
+
+=head1 NAME
+
+Path::Dispatcher::Rule::Metadata - match path's metadata
+
+=head1 SYNOPSIS
+
+    my $path = Path::Dispatcher::Path->new(
+        path => '/REST/Ticket'
+        metadata => {
+            http_method => 'POST',
+        },
+    );
+
+    my $rule = Path::Dispatcher::Rule::Metadata->new(
+        field   => 'http_method',
+        matcher => Path::Dispatcher::Rule::Eq->new(string => 'POST'),
+    );
+
+    $rule->run($path);
+
+=head1 DESCRIPTION
+
+Rules of this class match the metadata portion of a path.
+
+=head1 ATTRIBUTES
+
+=head2 field
+
+The metadata field/key name.
+
+=head2 matcher
+
+A L<Path::Dispatcher::Rule> object for matching against the value of the field.
+
+=cut
+

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list