| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package WWW::ORCID; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 53999 | use strict; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 25 |  | 
| 4 | 1 |  |  | 1 |  | 5 | use warnings; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 32 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | our $VERSION = 0.0401; | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 1 |  |  | 1 |  | 247 | use Class::Load qw(try_load_class); | 
|  | 1 |  |  |  |  | 15365 |  | 
|  | 1 |  |  |  |  | 53 |  | 
| 9 | 1 |  |  | 1 |  | 7 | use Carp; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 39 |  | 
| 10 | 1 |  |  | 1 |  | 262 | use namespace::clean; | 
|  | 1 |  |  |  |  | 6034 |  | 
|  | 1 |  |  |  |  | 6 |  | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | my $DEFAULT_VERSION = '2.0'; | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | sub new { | 
| 15 | 0 |  |  | 0 | 0 |  | my $self    = shift; | 
| 16 | 0 | 0 |  |  |  |  | my $opts    = ref $_[0] ? {%{$_[0]}} : {@_}; | 
|  | 0 |  |  |  |  |  |  | 
| 17 | 0 |  | 0 |  |  |  | my $version = $opts->{version} ||= $DEFAULT_VERSION; | 
| 18 | 0 |  |  |  |  |  | $version =~ s/\./_/g; | 
| 19 | 0 | 0 |  |  |  |  | $version .= '_public' if $opts->{public}; | 
| 20 | 0 |  |  |  |  |  | my $class = "WWW::ORCID::API::v${version}"; | 
| 21 | 0 | 0 |  |  |  |  | try_load_class($class) or croak("Could not load $class: $!"); | 
| 22 | 0 |  |  |  |  |  | $class->new($opts); | 
| 23 |  |  |  |  |  |  | } | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | 1; | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | __END__ |