File Coverage

blib/lib/Business/Mondo/Currency.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             package Business::Mondo::Currency;
2              
3             =head1 NAME
4              
5             Business::Mondo::Currency
6              
7             =head1 DESCRIPTION
8              
9             A role containing currency attributes / methods
10              
11             =cut
12              
13 10     10   3986 use strict;
  10         12  
  10         252  
14 10     10   38 use warnings;
  10         11  
  10         229  
15              
16 10     10   34 use Moo::Role;
  10         11  
  10         54  
17 10     10   2456 use Types::Standard qw/ :all /;
  10         16  
  10         67  
18 10     10   252898 use Data::Currency;
  10         523050  
  10         992  
19              
20             has [ qw/ currency local_currency / ] => (
21             is => 'ro',
22             isa => Maybe[InstanceOf['Data::Currency']],
23             coerce => sub {
24             my ( $args ) = @_;
25              
26             return undef if ! $args;
27              
28             if ( ! ref( $args ) ) {
29              
30             $args = Data::Currency->new({
31             code => $args,
32             });
33             }
34              
35             return $args;
36             },
37             );
38              
39             =head1 AUTHOR
40              
41             Lee Johnson - C<leejo@cpan.org>
42              
43             This library is free software; you can redistribute it and/or modify it under
44             the same terms as Perl itself. If you would like to contribute documentation,
45             features, bug fixes, or anything else then please raise an issue / pull request:
46              
47             https://github.com/leejo/business-mondo
48              
49             =cut
50              
51             1;
52              
53             # vim: ts=4:sw=4:et