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