]> git.donarmstrong.com Git - liborg-parser-perl.git/blob - lib/Org/Element/ListItem.pm
Import original source of Org-Parser 0.23
[liborg-parser-perl.git] / lib / Org / Element / ListItem.pm
1 package Org::Element::ListItem;
2
3 use 5.010;
4 use locale;
5 use Moo;
6 extends 'Org::Element';
7
8 our $VERSION = '0.23'; # VERSION
9
10 has bullet => (is => 'rw');
11 has check_state => (is => 'rw');
12 has desc_term => (is => 'rw');
13
14 sub header_as_string {
15     my ($self) = @_;
16     join("",
17          $self->parent->indent,
18          $self->bullet, " ",
19          defined($self->check_state) ? "[".$self->check_state."]" : "",
20      );
21 }
22
23 sub as_string {
24     my ($self) = @_;
25     $self->header_as_string . $self->children_as_string;
26 }
27
28 1;
29 #ABSTRACT: Represent Org list item
30
31
32 __END__
33 =pod
34
35 =head1 NAME
36
37 Org::Element::ListItem - Represent Org list item
38
39 =head1 VERSION
40
41 version 0.23
42
43 =head1 DESCRIPTION
44
45 Must have L<Org::Element::List> as parent.
46
47 Derived from L<Org::Element>.
48
49 =head1 ATTRIBUTES
50
51 =head2 bullet
52
53 =head2 check_state
54
55 undef, " ", "X" or "-".
56
57 =head2 desc_term
58
59 Description term (for description list).
60
61 =head1 METHODS
62
63 =for Pod::Coverage header_as_string as_string
64
65 =head1 AUTHOR
66
67 Steven Haryanto <stevenharyanto@gmail.com>
68
69 =head1 COPYRIGHT AND LICENSE
70
71 This software is copyright (c) 2012 by Steven Haryanto.
72
73 This is free software; you can redistribute it and/or modify it under
74 the same terms as the Perl 5 programming language system itself.
75
76 =cut
77