From a79bf3fb60ae2a98e17ed8bb1144a28eec8849f3 Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 6 Dec 2008 23:30:05 -0500 Subject: add documentation skeleton --- lib/MooseX/Role/Matcher.pm | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) 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, or browse to +L. + +=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 + +=item * CPAN Ratings + +L + +=item * RT: CPAN's request tracker + +L + +=item * Search CPAN + +L + +=back + +=cut + 1; -- cgit v1.2.3