line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Verby::Config::Data::Mutable; |
4
|
2
|
|
|
2
|
|
23797
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends qw/Verby::Config::Data/; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = "0.05"; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Carp qw/croak/; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub set { |
13
|
|
|
|
|
|
|
my ( $self, $field, $value ) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$self->data->{$field} = $value; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub export { |
19
|
|
|
|
|
|
|
my ( $self, $field ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
if ($self->exists($field)){ |
22
|
|
|
|
|
|
|
my $value = $self->extract($field); |
23
|
|
|
|
|
|
|
foreach my $parent ($self->parents){ |
24
|
|
|
|
|
|
|
$parent->set($field, $value); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} else { |
27
|
|
|
|
|
|
|
croak "key $field does not exist in $self"; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub export_all { |
32
|
|
|
|
|
|
|
my $self = shift; |
33
|
|
|
|
|
|
|
foreach my $field (keys %{ $self->data }){ |
34
|
|
|
|
|
|
|
$self->export($field); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__PACKAGE__ |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=pod |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Verby::Config::Data::Mutable - |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
use Verby::Config::Data::Mutable; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 DESCRIPTION |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 METHODS |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=over 4 |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=item B<set> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item B<export> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item B<export_all> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=back |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 BUGS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
None that we are aware of. Of course, if you find a bug, let us know, and we will be sure to fix it. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 CODE COVERAGE |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
We use B<Devel::Cover> to test the code coverage of the tests, please refer to COVERAGE section of the L<Verby> module for more information. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 SEE ALSO |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 AUTHOR |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Yuval Kogman, E<lt>nothingmuch@woobling.orgE<gt> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Copyright 2005-2008 by Infinity Interactive, Inc. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
L<http://www.iinteractive.com> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
87
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |