-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move all actual logic to Data::Perl::Role, split from consumers
- Loading branch information
Matt Phillips
committed
Feb 11, 2013
1 parent
c49bc2e
commit 9e0e38c
Showing
12 changed files
with
176 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package Data::Perl::Bool; | ||
|
||
# ABSTRACT: Wrapping class for boolean values. | ||
|
||
use strictures 1; | ||
|
||
use Role::Tiny::With; | ||
|
||
with 'Data::Perl::Role::Bool'; | ||
|
||
1; | ||
__END__ | ||
==pod | ||
=head1 SYNOPSIS | ||
use Data::Perl qw/bool/; | ||
my $bool = bool(0); | ||
$bool->toggle; # 1 | ||
$bool->unset; # 0 | ||
=head1 DESCRIPTION | ||
This class is a simple consumer of the L<Data::Perl::Role::Bool> role, which | ||
provides all functionality. You probably want to look there instead. | ||
=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package Data::Perl::Code; | ||
|
||
# ABSTRACT: Wrapping class for Perl coderefs. | ||
|
||
use strictures 1; | ||
|
||
use Role::Tiny::With; | ||
|
||
with 'Data::Perl::Role::Code'; | ||
|
||
1; | ||
|
||
__END__ | ||
==pod | ||
=head1 SYNOPSIS | ||
use Data::Perl qw/code/; | ||
my $code = code(sub { 'Foo'} ); | ||
$code->execute(); # returns 'Foo'; | ||
=head1 DESCRIPTION | ||
This class is a simple consumer of the L<Data::Perl::Role::Code> role, which | ||
provides all functionality. You probably want to look there instead. | ||
=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package Data::Perl::Counter; | ||
|
||
# ABSTRACT: Wrapping class for a simple numeric counter. | ||
|
||
use strictures 1; | ||
|
||
use Role::Tiny::With; | ||
|
||
with 'Data::Perl::Role::Counter'; | ||
|
||
1; | ||
__END__ | ||
==pod | ||
=head1 SYNOPSIS | ||
use Data::Perl qw/counter/; | ||
my $c = counter(4); | ||
$c->inc; # $c == 5 | ||
$c->reset; # $c == 0 | ||
=head1 DESCRIPTION | ||
This class is a simple consumer of the L<Data::Perl::Role::Counter> role, which | ||
provides all functionality. You probably want to look there instead. | ||
=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package Data::Perl::Number; | ||
|
||
# ABSTRACT: Wrapping class for Perl scalar numbers. | ||
|
||
use strictures 1; | ||
|
||
use Role::Tiny::With; | ||
|
||
with 'Data::Perl::Role::Number'; | ||
|
||
1; | ||
__END__ | ||
==pod | ||
=head1 SYNOPSIS | ||
use Data::Perl qw/number/; | ||
my $num = number(123); | ||
$num->add(5); # $num == 128 | ||
$num->div(2); # $num == 64 | ||
=head1 DESCRIPTION | ||
This class is a simple consumer of the L<Data::Perl::Role::Number> role, which | ||
provides all functionality. You probably want to look there instead. | ||
=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,29 @@ | ||
package Data::Perl::String; | ||
|
||
# ABSTRACT: Wrapping class for Perl scalar strings. | ||
|
||
use strictures 1; | ||
|
||
use Role::Tiny::With; | ||
|
||
with 'Data::Perl::Role::String'; | ||
|
||
1; | ||
|
||
__END__ | ||
==pod | ||
=head1 SYNOPSIS | ||
use Data::Perl qw/string/; | ||
my $string = string("foo\n"); | ||
$string->chomp; # returns 1, $string == "foo" | ||
=head1 DESCRIPTION | ||
This class is a simple consumer of the L<Data::Perl::Role::String> role, which | ||
provides all functionality. You probably want to look there instead. | ||
=cut |