| 1 | package Config::Tiny::Singleton; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 2 | our $VERSION = 0.02; | |||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use base qw| | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | Config::Tiny | ||||||||||
| 8 | Class::Singleton | ||||||||||
| 9 | Class::Data::Inheritable | ||||||||||
| 10 | 2 | |; | |||||||||
| 11 | |||||||||||
| 12 | 2 | __PACKAGE__->mk_classdata($_) for qw/file errstr/; | |||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | sub _new_instance { | ||||||||
|
Subroutine
_new_instance: called CC=2 SCAR=7.9
| |||||||||||
| 15 | 1 | my $class = shift; | |||||||||
| 16 | 1 | my $file = $class->file; | |||||||||
| 17 | 1 | ▶ | unless($file){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | require Carp; | |||||||||
| 19 | 0 | Carp::croak "set file before creating instance."; | |||||||||
| 20 | } | ||||||||||
| 21 | 1 | return $class->read($file); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub _error { | ||||||||
|
Subroutine
_error: not called CC=1 SCAR=6.9
| |||||||||||
| 25 | 0 | my($self, $msg) = @_; | |||||||||
| 26 | 0 | $self->errstr($msg); | |||||||||
| 27 | 0 | undef; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 2 | 1; | |||||||||
| 31 | __END__ | ||||||||||