File Coverage

blib/lib/CXC/Number/Grid/Role/BigNum.pm
Criterion Covered Total %
statement 18 18 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 25 25 100.0


line stmt bran cond sub pod time code
1             package CXC::Number::Grid::Role::BigNum;
2              
3             # ABSTRACT: Role to return Math::BigFloats
4              
5 2     2   225532 use v5.28;
  2         10  
6              
7 2     2   373 use Moo::Role;
  2         12296  
  2         25  
8              
9             our $VERSION = '0.13';
10              
11 2     2   1471 use experimental 'signatures';
  2         1255  
  2         14  
12 2     2   738 use namespace::clean;
  2         13676  
  2         14  
13              
14 4     4   354 sub _convert ( $self, $bignum ) {
  4         6  
  4         4  
  4         7  
15 4         26 require Ref::Util;
16              
17             return Ref::Util::is_plain_arrayref( $bignum )
18 4 100       22 ? [ map { $_->copy } $bignum->@* ]
  23         437  
19             : $bignum->copy;
20             }
21              
22             #
23             # This file is part of CXC-Number
24             #
25             # This software is Copyright (c) 2019 by Smithsonian Astrophysical Observatory.
26             #
27             # This is free software, licensed under:
28             #
29             # The GNU General Public License, Version 3, June 2007
30             #
31              
32             1;
33              
34             __END__
35              
36             =pod
37              
38             =for :stopwords Diab Jerius Smithsonian Astrophysical Observatory
39              
40             =head1 NAME
41              
42             CXC::Number::Grid::Role::BigNum - Role to return Math::BigFloats
43              
44             =head1 VERSION
45              
46             version 0.13
47              
48             =head1 SYNOPSIS
49              
50             my $obj = CXC::Number::Grid->new( edges => \@edges );
51             Moo::Role->apply_role_to_object( $obj, 'CXC::Number::Grid::Role::BigNum' );
52              
53             =head1 DESCRIPTION
54              
55             A L<Moo> role providing a C<_convert> method which returns copies of the
56             passed L<Math::BigFloat> arrays and scalars.
57              
58             =head1 INTERNALS
59              
60             =head1 SUPPORT
61              
62             =head2 Bugs
63              
64             Please report any bugs or feature requests to bug-cxc-number@rt.cpan.org or through the web interface at: L<https://rt.cpan.org/Public/Dist/Display.html?Name=CXC-Number>
65              
66             =head2 Source
67              
68             Source is available at
69              
70             https://gitlab.com/djerius/cxc-number
71              
72             and may be cloned from
73              
74             https://gitlab.com/djerius/cxc-number.git
75              
76             =head1 SEE ALSO
77              
78             Please see those modules/websites for more information related to this module.
79              
80             =over 4
81              
82             =item *
83              
84             L<CXC::Number|CXC::Number>
85              
86             =item *
87              
88             L<CXC::Number::Sequence|CXC::Number::Sequence>
89              
90             =back
91              
92             =head1 AUTHOR
93              
94             Diab Jerius <djerius@cpan.org>
95              
96             =head1 COPYRIGHT AND LICENSE
97              
98             This software is Copyright (c) 2019 by Smithsonian Astrophysical Observatory.
99              
100             This is free software, licensed under:
101              
102             The GNU General Public License, Version 3, June 2007
103              
104             =cut