line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Ledger::Journal; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2017-06-16'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.06'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
25
|
use 5.010; |
|
1
|
|
|
|
|
3
|
|
7
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
8
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
238
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
12
|
|
|
12
|
1
|
41
|
my ($class, %attrs) = @_; |
12
|
|
|
|
|
|
|
|
13
|
12
|
50
|
|
|
|
36
|
if (!$attrs{_parsed}) { |
14
|
0
|
|
|
|
|
0
|
$attrs{_parsed} = []; |
15
|
|
|
|
|
|
|
} |
16
|
12
|
50
|
|
|
|
27
|
if (!$attrs{_parser}) { |
17
|
0
|
|
|
|
|
0
|
require Ledger::Parser; |
18
|
0
|
|
|
|
|
0
|
$attrs{_parser} = Ledger::Parser->new; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
12
|
|
|
|
|
55
|
bless \%attrs, $class; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub empty { |
25
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
26
|
|
|
|
|
|
|
#$self->_discard_cache; |
27
|
0
|
|
|
|
|
0
|
$self->{_parsed} = []; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub as_string { |
31
|
12
|
|
|
12
|
1
|
3887
|
my $self = shift; |
32
|
12
|
|
|
|
|
68
|
$self->{_parser}->_parsed_as_string($self->{_parsed}); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
1
|
|
9
|
use overload '""' => \&as_string; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
# ABSTRACT: Represent Ledger journal |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |