line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Money::Converter; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$Data::Money::Converter::VERSION = '0.07'; |
4
|
|
|
|
|
|
|
$Data::Money::Converter::AUTHORITY = 'cpan:GPHAT'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Data::Money::Converter - Moo Role for Data::Money Converters. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.07 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
4
|
|
|
4
|
|
27197
|
use Moo::Role; |
|
4
|
|
|
|
|
56000
|
|
|
4
|
|
|
|
|
63
|
|
17
|
4
|
|
|
4
|
|
3495
|
use namespace::clean; |
|
4
|
|
|
|
|
34312
|
|
|
4
|
|
|
|
|
20
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
requires 'convert'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 DESCRIPTION |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
This simple module provides a base for building currency conversion backends for |
24
|
|
|
|
|
|
|
L. You can use this module either as a basis for understanding the |
25
|
|
|
|
|
|
|
common features or as a guide for implementing your own converter. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
package MoneyConverter; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
use Moo; |
32
|
|
|
|
|
|
|
use namespace::clean; |
33
|
|
|
|
|
|
|
with 'Data::Money::Converter'; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub convert { |
36
|
|
|
|
|
|
|
my ($self, $money, $code) = @_; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
return $money->clone( |
39
|
|
|
|
|
|
|
value => $money->value * 2, |
40
|
|
|
|
|
|
|
code => $code |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 METHODS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This role requires that you implement a C method. It should expect two |
49
|
|
|
|
|
|
|
arguments: an isntance of L and a 3-character currency code. It does |
50
|
|
|
|
|
|
|
not do any checking of the code as not all conversion implementations may support |
51
|
|
|
|
|
|
|
all codes. It is recommended that you consult L. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Cory G Watson, C<< >> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Currently maintained by Mohammad S Anwar (MANWAR) C<< >> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 REPOSITORY |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
L |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 SEE ALSO |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
L |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Copyright 2010 Cory G Watson. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the |
72
|
|
|
|
|
|
|
terms of either: the GNU General Public License as published by the Free Software |
73
|
|
|
|
|
|
|
Foundation; or the Artistic License. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; # End of Data::Money::Converter |