summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2008-12-06 23:30:05 -0500
committerdoy <doy@tozt.net>2008-12-06 23:30:05 -0500
commita79bf3fb60ae2a98e17ed8bb1144a28eec8849f3 (patch)
tree69ccf59a480b104b2e62f9068e4ac54b00247336
parentca7642226a2992e3cc4e4e8345a0fe5be6fef38c (diff)
downloadmoosex-role-matcher-a79bf3fb60ae2a98e17ed8bb1144a28eec8849f3.tar.gz
moosex-role-matcher-a79bf3fb60ae2a98e17ed8bb1144a28eec8849f3.zip
add documentation skeleton
-rw-r--r--lib/MooseX/Role/Matcher.pm76
1 files changed, 76 insertions, 0 deletions
diff --git a/lib/MooseX/Role/Matcher.pm b/lib/MooseX/Role/Matcher.pm
index 0bb4ce0..4ca1f5b 100644
--- a/lib/MooseX/Role/Matcher.pm
+++ b/lib/MooseX/Role/Matcher.pm
@@ -4,6 +4,20 @@ use MooseX::Role::Parameterized;
use List::Util qw/first/;
use List::MoreUtils qw/any all/;
+# ABSTRACT: generic object matching based on attributes and methods
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+=cut
+
+=head1 PARAMETERS
+
+=head2 default_match
+
+=cut
+
parameter default_match => (
is => 'ro',
isa => 'Str',
@@ -22,22 +36,38 @@ method _apply_to_matches => sub {
$on_match->(sub { $_->match(@matchers) }, @list);
};
+=method first_match
+
+=cut
+
method first_match => sub {
my $class = shift;
$class->_apply_to_matches(\&first, @_);
};
+=method grep_matches
+
+=cut
+
method grep_matches => sub {
my $class = shift;
my $grep = sub { my $code = shift; grep { $code->() } @_ };
$class->_apply_to_matches($grep, @_);
};
+=method any_match
+
+=cut
+
method any_match => sub {
my $class = shift;
$class->_apply_to_matches(\&any, @_);
};
+=method all_match
+
+=cut
+
method all_match => sub {
my $class = shift;
$class->_apply_to_matches(\&all, @_);
@@ -60,6 +90,10 @@ method _match => sub {
return $value eq $seek;
};
+=method match
+
+=cut
+
method match => sub {
my $self = shift;
my %args = @_;
@@ -88,4 +122,46 @@ method match => sub {
no MooseX::Role::Parameterized;
+=head1 TODO
+
+=head1 SEE ALSO
+
+=head1 BUGS
+
+No known bugs.
+
+Please report any bugs through RT: email
+C<bug-moosex-role-matcher at rt.cpan.org>, or browse to
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Role-Matcher>.
+
+=head1 SUPPORT
+
+You can find this documentation for this module with the perldoc command.
+
+ perldoc MooseX::Role::Matcher
+
+You can also look for information at:
+
+=over 4
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/MooseX-Role-Matcher>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/MooseX-Role-Matcher>
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Role-Matcher>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/MooseX-Role-Matcher>
+
+=back
+
+=cut
+
1;