1 package Org::Element::Drawer;
6 extends 'Org::Element';
8 our $VERSION = '0.23'; # VERSION
10 has name => (is => 'rw');
11 has properties => (is => 'rw');
14 my ($self, $args) = @_;
15 my $doc = $self->document;
16 my $pass = $args->{pass} // 1;
19 die "Unknown drawer name: ".$self->name
20 unless $self->name ~~ @{$doc->drawer_names};
24 sub _parse_properties {
25 my ($self, $raw_content) = @_;
26 $self->properties({}) unless $self->properties;
27 while ($raw_content =~ /^[ \t]*:(\w+):[ \t]+
28 ($Org::Document::args_re)[ \t]*(?:\R|\z)/mxg) {
29 my $args = Org::Document::__parse_args($2);
30 $self->properties->{$1} = @$args == 1 ? $args->[0] : $args;
37 ":", $self->name, ":\n",
38 $self->children_as_string,
43 # ABSTRACT: Represent Org drawer
50 Org::Element::Drawer - Represent Org drawer
58 Derived from L<Org::Element>.
66 =head2 properties => HASH
68 Collected properties in the drawer.
72 =for Pod::Coverage BUILD as_string
76 Steven Haryanto <stevenharyanto@gmail.com>
78 =head1 COPYRIGHT AND LICENSE
80 This software is copyright (c) 2012 by Steven Haryanto.
82 This is free software; you can redistribute it and/or modify it under
83 the same terms as the Perl 5 programming language system itself.