Finance-Currency-Convert-Custom
view release on metacpan or search on metacpan
lib/Finance/Currency/Convert/Custom.pm view on Meta::CPAN
package Finance::Currency::Convert::Custom;
use strict;
use base qw(Finance::Currency::Convert);
use LWP::UserAgent;
our $VERSION = '1.00';
sub updateRates() {
my $self = shift;
my $sub_ref = shift;
my @CurrencyList = @_;
unless(ref $sub_ref eq 'CODE'){
#case of not defined own sub and sent countries list as params :)
unless(ref $sub_ref){
push @CurrencyList, $sub_ref;
}
lib/Finance/Currency/Convert/Custom.pm view on Meta::CPAN
$self->setRate($source, $target, &{$sub_ref}($source, $target));
}
}
foreach my $source (sort keys %{ $self->{CurrencyRates}}) {
foreach my $target (@CurrencyList) {
$self->setRate($source, $target, &{$sub_ref}($source, $target));
}
}
}
sub updateRate() {
my $self = shift;
my $sub_ref = shift;
my $source = shift;
my $target = shift;
unless(ref $sub_ref eq 'CODE'){
#case of not defined own sub and sent countries list as params :)
unless(ref $sub_ref){
$target = $source;
$source = $sub_ref;
}
( run in 0.319 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )