File Coverage

blib/lib/WebService/Flixster/Currency.pm
Criterion Covered Total %
statement 16 18 88.8
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 22 24 91.6


line stmt bran cond sub pod time code
1             # $Id: Currency.pm 7373 2012-04-09 18:00:33Z chris $
2              
3             package WebService::Flixster::Currency;
4              
5 2     2   11 use strict;
  2         4  
  2         77  
6 2     2   11 use warnings;
  2         3  
  2         80  
7              
8             our $VERSION = '0.02';
9              
10 2     2   18 use base qw(Class::Accessor);
  2         4  
  2         137  
11              
12 2     2   10 use Carp;
  2         5  
  2         149  
13             our @CARP_NOT = qw(WebService::Flixster WebService::Flixster::Movie);
14              
15 2     2   2733 use HTML::Entities;
  2         235763  
  2         229  
16 2     2   1726 use Math::Currency;
  0            
  0            
17              
18             sub _new {
19             my $class = shift;
20             my $ws = shift;
21             my $amount = shift;
22             my $currencySymbol = shift;
23              
24             if ($amount eq "") { return undef; }
25              
26             my $self = Math::Currency->new($amount);
27             $self->format('CURRENCY_SYMBOL',decode_entities($currencySymbol));
28              
29             return $self;
30             }
31              
32             1;