Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Catmandu::Fix::Bind::Group as role
- Loading branch information
Showing
10 changed files
with
76 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package Catmandu::Fix::Bind::Group; | ||
|
||
use Catmandu::Sane; | ||
|
||
our $VERSION = '1.0507'; | ||
|
||
use Moo::Role; | ||
use namespace::clean; | ||
|
||
1; | ||
|
||
__END__ | ||
=pod | ||
=head1 NAME | ||
Catmandu::Fix::Bind::Group - a role for a binder that executes all fixes as one group | ||
=head1 SYNOPSIS | ||
# Fixes fix1(), ... fixN() will be passed as one function to the internal 'bind' method | ||
do identity() | ||
fix1() | ||
. | ||
. | ||
fixN() | ||
end | ||
# Fixes fix1(), ... fixN() will be passed as one by one to the internal 'bind' method | ||
do maybe() | ||
fix1() | ||
. | ||
. | ||
fixN() | ||
end | ||
=head1 DESCRIPTION | ||
This role flags a L<Catmandu::Fix::Bind> implementation as a L<Catmandu::Fix::Bind::Group>. | ||
All fixes inside a Bind will be treated as one singular function. | ||
=head1 SEE ALSO | ||
L<Catmandu::Fix::Bind> | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use Test::Exception; | ||
use Catmandu::Util qw(:is); | ||
|
||
my $pkg; | ||
|
||
BEGIN { | ||
$pkg = 'Catmandu::Fix::Bind::Group'; | ||
use_ok $pkg; | ||
} | ||
require_ok $pkg; | ||
|
||
done_testing 2; |