| 1 | package Finance::QuoteHist; | ||||||||||||||||||
| 2 | |||||||||||||||||||
| 3 | # Simple aggregator for Finance::QuoteHist::Generic instances, | ||||||||||||||||||
| 4 | # the primary function of which is to specify the order in which | ||||||||||||||||||
| 5 | # to try the modules upon failure. | ||||||||||||||||||
| 6 | |||||||||||||||||||
| 7 | 5 | ▶ | use strict; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 8 | 5 | ▶ | use vars qw($VERSION $AUTOLOAD); | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 9 | 5 | ▶ | use Carp; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 10 | |||||||||||||||||||
| 11 | 5 | ▶ | use Finance::QuoteHist::Generic; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 12 | |||||||||||||||||||
| 13 | 5 | $VERSION = '1.30'; | |||||||||||||||||
| 14 | |||||||||||||||||||
| 15 | 5 | my @DEFAULT_ENGINES = qw( | |||||||||||||||||
| 16 | Finance::QuoteHist::Yahoo | ||||||||||||||||||
| 17 | ); | ||||||||||||||||||
| 18 | |||||||||||||||||||
| 19 | sub new { | ||||||||||||||||||
| 20 | 0 | ▶ | my $class = shift; | ||||||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||
| 21 | 0 | my %parms = @_; | |||||||||||||||||
| 22 | 0 | ▶ | if (!$parms{lineup}) { | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 23 | 0 | $parms{lineup} = [@DEFAULT_ENGINES]; | |||||||||||||||||
| 24 | } | ||||||||||||||||||
| 25 | elsif (! ref $parms{lineup}) { | ||||||||||||||||||
| 26 | 0 | $parms{lineup} = [$parms{lineup}]; | |||||||||||||||||
| 27 | } | ||||||||||||||||||
| 28 | elsif (ref $parms{lineup} ne 'ARRAY') { | ||||||||||||||||||
| 29 | 0 | croak "Lineup must be passed as an array ref or single-entry string\n"; | |||||||||||||||||
| 30 | } | ||||||||||||||||||
| 31 | |||||||||||||||||||
| 32 | # Instantiate the first, pass the rest as champions to the first | ||||||||||||||||||
| 33 | 0 | my $first = shift @{$parms{lineup}}; | |||||||||||||||||
| 34 | |||||||||||||||||||
| 35 | 0 | eval "require $first"; | |||||||||||||||||
| 36 | 0 | ▶ | croak $@ if $@; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 37 | |||||||||||||||||||
| 38 | 0 | my $self = $first->new(%parms); | |||||||||||||||||
| 39 | |||||||||||||||||||
| 40 | 0 | $self; | |||||||||||||||||
| 41 | } | ||||||||||||||||||
| 42 | |||||||||||||||||||
| 43 | 0 | ▶ | sub default_lineup { @DEFAULT_ENGINES } | ||||||||||||||||
|
Subroutine
default_lineup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||
| 44 | |||||||||||||||||||
| 45 | 0 | ▶ | sub granularities { Finance::QuoteHist::Generic->granularities } | ||||||||||||||||
|
Subroutine
granularities: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||
| 46 | |||||||||||||||||||
| 47 | 5 | 1; | |||||||||||||||||
| 48 | __END__ | ||||||||||||||||||