line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::View::REST::YAML; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
54704
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
6
|
use base 'Catalyst::Base'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
825
|
|
5
|
|
|
|
|
|
|
use YAML; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Catalyst::View::REST::YAML - YAML View Class |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# lib/MyApp/View/REST.pm |
16
|
|
|
|
|
|
|
package MyApp::View::REST; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use base 'Catalyst::View::REST::YAML'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
1; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$c->forward('MyApp::View::REST'); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This is the C<YAML> view class. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 OVERLOADED METHODS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head3 process |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Serializes $c->stash to $c->response->output. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub process { |
37
|
|
|
|
|
|
|
my ( $self, $c ) = @_; |
38
|
|
|
|
|
|
|
$c->response->headers->content_type('text/yaml-1.0'); |
39
|
|
|
|
|
|
|
$c->response->output( Dump $c->stash ); |
40
|
|
|
|
|
|
|
return 1; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SEE ALSO |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
L<Catalyst>. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 AUTHOR |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Sebastian Riedel, C<sri@cpan.org> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 COPYRIGHT |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
This program is free software, you can redistribute it and/or modify it under |
54
|
|
|
|
|
|
|
the same terms as Perl itself. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |