Verby::Config::Source - Verby::Config::Source documentation


Verby documentation Contained in the Verby distribution.

Index


Code Index:

NAME

Top

Verby::Config::Source -

SYNOPSIS

Top

	use Verby::Config::Source;

DESCRIPTION

Top

METHODS

Top

new
get_key

BUGS

Top

None that we are aware of. Of course, if you find a bug, let us know, and we will be sure to fix it.

CODE COVERAGE

Top

We use Devel::Cover to test the code coverage of the tests, please refer to COVERAGE section of the Verby module for more information.

SEE ALSO

Top

AUTHOR

Top

Yuval Kogman, <nothingmuch@woobling.org>

COPYRIGHT AND LICENSE

Top


Verby documentation Contained in the Verby distribution.

#!/usr/bin/perl

package Verby::Config::Source;
use Moose;

our $VERSION = "0.05";

extends qw/Verby::Config::Data/;

use Tie::Memoize;

use Scalar::Util ();

has data => (
	isa => "HashRef",
	is  => "ro",
	lazy    => 1,
	default => sub {
		my $self = shift;
		Scalar::Util::weaken($self); # closure leak otherwise		
		tie my %data, 'Tie::Memoize', sub { $self->get_key(shift) };
		return \%data,
	},
);

sub get_key {
	die "subclass should extract keys from real config source";
}

__PACKAGE__

__END__