File Coverage

blib/lib/Syntax/Collection/Moose.pm
Criterion Covered Total %
statement 27 33 81.8
branch 0 2 0.0
condition 0 2 0.0
subroutine 8 9 88.8
pod 0 2 0.0
total 35 48 72.9


line stmt bran cond sub pod time code
1 1     1   17955 use 5.018;
  1         3  
2              
3             our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
4              
5             package Syntax::Collection::Moose {
6             our $VERSION = '0.0601';
7 1     1   11 use Syntax::Collection::Basic;
  1         3  
  1         9  
8              
9             # see http://blogs.perl.org/users/ovid/2013/09/building-your-own-moose.html
10 1     1   2011 use Moose();
  1         469461  
  1         31  
11 1     1   399 use MooseX::StrictConstructor();
  1         26205  
  1         29  
12 1     1   354 use Moops();
  1         27213  
  1         41  
13 1     1   282 use Kavorka();
  1         2096  
  1         46  
14 1     1   13 use Moose::Exporter;
  1         3  
  1         15  
15              
16             Moose::Exporter->setup_import_methods(
17             with_meta => ['has'],
18             also => ['Moose'],
19             );
20              
21             sub init_meta {
22 1     1 0 1415 my $class = shift;
23 1         5 my %params = @_;
24 1         2 my $for_class = $params{'for_class'};
25              
26 1         5 Moose->init_meta(@_);
27 1         5094 MooseX::StrictConstructor->import({ into => $for_class });
28 1         10201 Moops->import(into => $for_class);
29 1         67202 Kavorka->import({ into => $for_class });
30             }
31              
32             sub has {
33 0     0 0   my $meta = shift;
34 0           my $name = shift;
35 0           my %options = @_;
36              
37 0   0       $options{'is'} //= 'ro';
38              
39 0 0         foreach (ref $name eq 'ARRAY' ? @$name : $name) {
40 0           $meta->add_attribute($_, %options);
41             }
42             }
43             }
44              
45             __END__
46              
47             =pod
48              
49             =encoding UTF-8
50              
51             =head1 NAME
52              
53             Syntax::Collection::Moose
54              
55             =head1 VERSION
56              
57             Version 0.0601, released 2017-10-31.
58              
59             =head1 STATUS
60              
61             Deprecated.
62              
63             =head1 SOURCE
64              
65             L<https://github.com/Csson/syntax-collection-basic>
66              
67             =head1 HOMEPAGE
68              
69             L<https://metacpan.org/release/Syntax-Collection-Basic>
70              
71             =head1 AUTHOR
72              
73             Erik Carlsson <info@code301.com>
74              
75             =head1 COPYRIGHT AND LICENSE
76              
77             This software is copyright (c) 2017 by Erik Carlsson.
78              
79             This is free software; you can redistribute it and/or modify it under
80             the same terms as the Perl 5 programming language system itself.
81              
82             =cut