]> git.donarmstrong.com Git - liborg-parser-perl.git/blob - lib/Org/Element/TimeRange.pm
Import original source of Org-Parser 0.23
[liborg-parser-perl.git] / lib / Org / Element / TimeRange.pm
1 package Org::Element::TimeRange;
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 ts1 => (is => 'rw');
11 has ts2 => (is => 'rw');
12
13 sub as_string {
14     my ($self) = @_;
15     return $self->_str if $self->_str;
16     join("",
17          $self->ts1->as_string,
18          "--",
19          $self->ts2->as_string
20      );
21 }
22
23 1;
24 # ABSTRACT: Represent Org time range (TS1--TS2)
25
26
27 =pod
28
29 =head1 NAME
30
31 Org::Element::TimeRange - Represent Org time range (TS1--TS2)
32
33 =head1 VERSION
34
35 version 0.23
36
37 =head1 DESCRIPTION
38
39 Derived from L<Org::Element>.
40
41 =head1 ATTRIBUTES
42
43 =head2 ts1 => TIMESTAMP ELEMENT
44
45 Starting timestamp.
46
47 =head2 ts2 => TIMESTAMP ELEMENT
48
49 Ending timestamp.
50
51 =head1 METHODS
52
53 =for Pod::Coverage as_string
54
55 =head1 AUTHOR
56
57 Steven Haryanto <stevenharyanto@gmail.com>
58
59 =head1 COPYRIGHT AND LICENSE
60
61 This software is copyright (c) 2012 by Steven Haryanto.
62
63 This is free software; you can redistribute it and/or modify it under
64 the same terms as the Perl 5 programming language system itself.
65
66 =cut
67
68
69 __END__
70