File Coverage

blib/lib/Statocles/Page/Plain.pm
Criterion Covered Total %
statement 4 4 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod 1 1 100.0
total 7 7 100.0


line stmt bran cond sub pod time code
1             package Statocles::Page::Plain;
2             our $VERSION = '0.085';
3             # ABSTRACT: A plain page (with templates)
4              
5 58     58   54590 use Statocles::Base 'Class';
  58         133  
  58         610  
6             with 'Statocles::Page';
7              
8             #pod =attr content
9             #pod
10             #pod The content of the page, already rendered to HTML.
11             #pod
12             #pod =cut
13              
14             has _content => (
15             is => 'ro',
16             isa => Str,
17             required => 1,
18             init_arg => 'content',
19             );
20              
21             #pod =method content
22             #pod
23             #pod my $html = $page->content;
24             #pod
25             #pod Get the content for this page.
26             #pod
27             #pod =cut
28              
29             sub content {
30 115     115 1 787 return $_[0]->_content;
31             }
32              
33             1;
34              
35             __END__
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Statocles::Page::Plain - A plain page (with templates)
44              
45             =head1 VERSION
46              
47             version 0.085
48              
49             =head1 SYNOPSIS
50              
51             my $page = Statocles::Page::Plain->new(
52             path => '/path/to/page.html',
53             content => '...',
54             );
55              
56             my $js = Statocles::Page::Plain->new(
57             path => '/js/app.js',
58             content => '...',
59             );
60              
61             =head1 DESCRIPTION
62              
63             This L<Statocles::Page> contains any content you want to put in it, while still
64             allowing for templates and layout. This is useful when you generate HTML (or
65             anything else) outside of Statocles.
66              
67             =head1 ATTRIBUTES
68              
69             =head2 content
70              
71             The content of the page, already rendered to HTML.
72              
73             =head1 METHODS
74              
75             =head2 content
76              
77             my $html = $page->content;
78              
79             Get the content for this page.
80              
81             =head1 AUTHOR
82              
83             Doug Bell <preaction@cpan.org>
84              
85             =head1 COPYRIGHT AND LICENSE
86              
87             This software is copyright (c) 2016 by Doug Bell.
88              
89             This is free software; you can redistribute it and/or modify it under
90             the same terms as the Perl 5 programming language system itself.
91              
92             =cut