]> git.donarmstrong.com Git - liborg-parser-perl.git/blob - lib/Org/Element/Footnote.pm
Import original source of Org-Parser 0.23
[liborg-parser-perl.git] / lib / Org / Element / Footnote.pm
1 package Org::Element::Footnote;
2
3 use 5.010;
4 use locale;
5 use Log::Any '$log';
6 use Moo;
7 extends 'Org::Element';
8
9 our $VERSION = '0.23'; # VERSION
10
11 has name => (is => 'rw');
12 has is_ref => (is => 'rw');
13 has def => (is => 'rw');
14
15 sub BUILD {
16     my ($self, $args) = @_;
17     $log->tracef("name = %s", $self->name);
18 }
19
20 sub as_string {
21     my ($self) = @_;
22
23     join("",
24          "[fn:", ($self->name // ""),
25          defined($self->def) ? ":".$self->def->as_string : "",
26          "]");
27 }
28
29 1;
30 # ABSTRACT: Represent Org footnote reference and/or definition
31
32
33 __END__
34 =pod
35
36 =head1 NAME
37
38 Org::Element::Footnote - Represent Org footnote reference and/or definition
39
40 =head1 VERSION
41
42 version 0.23
43
44 =head1 DESCRIPTION
45
46 Derived from L<Org::Element>.
47
48 =head1 ATTRIBUTES
49
50 =head2 name => STR|undef
51
52 Can be undef, for anonymous footnote (but in case of undef, is_ref must be
53 true and def must also be set).
54
55 =head2 is_ref => BOOL
56
57 Set to true to make this a footnote reference.
58
59 =head2 def => TEXT ELEMENT
60
61 Set to make this a footnote definition.
62
63 =head1 METHODS
64
65 =for Pod::Coverage as_string BUILD
66
67 =head1 AUTHOR
68
69 Steven Haryanto <stevenharyanto@gmail.com>
70
71 =head1 COPYRIGHT AND LICENSE
72
73 This software is copyright (c) 2012 by Steven Haryanto.
74
75 This is free software; you can redistribute it and/or modify it under
76 the same terms as the Perl 5 programming language system itself.
77
78 =cut
79