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 11     11   4207 use strict;
  11         16  
  11         254  
14 11     11   32 use warnings;
  11         12  
  11         207  
15              
16 11     11   29 use Moo::Role;
  11         13  
  11         59  
17 11     11   2639 use Types::Standard qw/ :all /;
  11         16  
  11         75  
18 11     11   265903 use Data::Currency;
  11         1543079  
  11         1063  
19              
20             has [ qw/ currency local_currency / ] => (
21             is => 'ro',
22             isa => Maybe[InstanceOf['Data::Currency']],
23             coerce => sub {
24             my ( $args ) = @_;
25              
26             if ( ! ref( $args ) ) {
27             $args = Data::Currency->new({
28             code => $args,
29             });
30             }
31              
32             return $args;
33             },
34             );
35              
36             =head1 AUTHOR
37              
38             Lee Johnson - C<leejo@cpan.org>
39              
40             This library is free software; you can redistribute it and/or modify it under
41             the same terms as Perl itself. If you would like to contribute documentation,
42             features, bug fixes, or anything else then please raise an issue / pull request:
43              
44             https://github.com/leejo/business-mondo
45              
46             =cut
47              
48             1;
49              
50             # vim: ts=4:sw=4:et