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