]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blob - lib/LaTeX/TikZ/Mod/Formatted.pm
e9b67a9f06c0117701cc9f70fd0d471bbca67430
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Mod / Formatted.pm
1 package LaTeX::TikZ::Mod::Formatted;
2
3 use strict;
4 use warnings;
5
6 =head1 NAME
7
8 LaTeX::TikZ::Mod::Formatted - Intermediate object between a modifier object and its code representation.
9
10 =head1 VERSION
11
12 Version 0.01
13
14 =cut
15
16 our $VERSION = '0.01';
17
18 use Any::Moose;
19 use Any::Moose 'Util::TypeConstraints';
20
21 =head1 ATTRIBUTES
22
23 =head2 C<type>
24
25 =cut
26
27 has 'type' => (
28  is       => 'ro',
29  isa      => enum([ qw/clip layer raw/ ]),
30  required => 1,
31 );
32
33 =head2 C<content>
34
35 =cut
36
37 has 'content' => (
38  is       => 'ro',
39  isa      => 'Str',
40  required => 1,
41 );
42
43 coerce 'LaTeX::TikZ::Mod::Formatted'
44     => from 'Str'
45     => via { LaTeX::TikZ::Mod::Formatted->new(type => 'raw', content => $_) };
46
47 =head1 METHODS
48
49 =head2 C<tag>
50
51 =cut
52
53 sub tag {
54  my ($self) = @_;
55
56  ref($self) . '/' . $self->type . '/' . $self->content;
57 }
58
59 __PACKAGE__->meta->make_immutable;
60
61 =head1 SEE ALSO
62
63 L<LaTeX::TikZ>.
64
65 =head1 AUTHOR
66
67 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
68
69 You can contact me by mail or on C<irc.perl.org> (vincent).
70
71 =head1 BUGS
72
73 Please report any bugs or feature requests to C<bug-latex-tikz at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LaTeX-TikZ>.
74 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
75
76 =head1 SUPPORT
77
78 You can find documentation for this module with the perldoc command.
79
80     perldoc LaTeX::TikZ
81
82 =head1 COPYRIGHT & LICENSE
83
84 Copyright 2010 Vincent Pit, all rights reserved.
85
86 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
87
88 =cut
89
90 1; # End of LaTeX::TikZ::Mod::Formatted