Data::Money::Converter - Moo Role for Data::Money Converters.
Version 0.07
This simple module provides a base for building currency conversion backends for Data::Money. You can use this module either as a basis for understanding the common features or as a guide for implementing your own converter.
package MoneyConverter; use Moo; use namespace::clean; with 'Data::Money::Converter'; sub convert { my ($self, $money, $code) = @_; return $money->clone( value => $money->value * 2, code => $code ); } 1;
This role requires that you implement a convert method. It should expect two arguments: an isntance of Data::Money and a 3-character currency code. It does not do any checking of the code as not all conversion implementations may support all codes. It is recommended that you consult Locale::Currency.
convert
Cory G Watson, <gphat at cpan.org>
<gphat at cpan.org>
Currently maintained by Mohammad S Anwar (MANWAR) <mohammad.anwar at yahoo.com>
<mohammad.anwar at yahoo.com>
https://github.com/manwar/Data-Money-Converter
Data::Money
Copyright 2010 Cory G Watson.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Data::Money::Converter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Money::Converter
CPAN shell
perl -MCPAN -e shell install Data::Money::Converter
For more information on module installation, please visit the detailed CPAN module installation guide.