File Coverage

blib/lib/Data/Perl/String/MooseLike.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Data::Perl::String::MooseLike;
2             $Data::Perl::String::MooseLike::VERSION = '0.001009';
3             # ABSTRACT: data::Perl::String subclass that simulates Moose's native traits.
4              
5 1     1   933 use strictures 1;
  1         1411  
  1         49  
6              
7 1     1   451 use Role::Tiny::With;
  1         239  
  1         49  
8 1     1   396 use Class::Method::Modifiers;
  1         1449  
  1         134  
9              
10             with 'Data::Perl::Role::String';
11              
12             my @methods = grep { $_ ne 'new' } Role::Tiny->methods_provided_by('Data::Perl::Role::String');
13              
14             around @methods => sub {
15             my $orig = shift;
16              
17             $orig->(\$_[0], @_[1..$#_]);
18             };
19              
20             1;
21              
22             =pod
23              
24             =encoding UTF-8
25              
26             =head1 NAME
27              
28             Data::Perl::String::MooseLike - data::Perl::String subclass that simulates Moose's native traits.
29              
30             =head1 VERSION
31              
32             version 0.001009
33              
34             =head1 SYNOPSIS
35              
36             use Data::Perl::Collection::String::MooseLike;
37              
38             my $string = Data::Perl::Collection::String::MooseLike->new("this is a string\n");
39              
40             $string->chomp;
41              
42             $string->substr(); # etc
43              
44             =head1 DESCRIPTION
45              
46             This class provides a wrapper and methods for interacting with a string. All
47             methods are written to emulate/match existing behavior that exists with Moose's
48             native traits. You should probably be looking at Data::Perl's documentation instead.
49              
50             =head1 SEE ALSO
51              
52             =over 4
53              
54             =item * L
55              
56             =item * L
57              
58             =back
59              
60             =head1 AUTHOR
61              
62             Toby Inkster
63              
64             =head1 COPYRIGHT AND LICENSE
65              
66             This software is copyright (c) 2020 by Matthew Phillips .
67              
68             This is free software; you can redistribute it and/or modify it under
69             the same terms as the Perl 5 programming language system itself.
70              
71             =cut
72              
73             __END__