/[Frey]/trunk/lib/Frey/View/JSON.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/lib/Frey/View/JSON.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 467 - (hide annotations)
Wed Nov 19 19:28:09 2008 UTC (15 years, 5 months ago) by dpavlin
File size: 322 byte(s)
rename class with experimental script
1 dpavlin 467 package Frey::View::JSON;
2 dpavlin 419 use Moose;
3    
4 dpavlin 448 extends 'Frey';
5     with 'Frey::Web';
6    
7 dpavlin 419 =head1 DESCRIPTION
8    
9     dump perl data as json
10    
11     =cut
12    
13     use JSON;
14    
15     has data => (
16     is => 'rw',
17     required => 1,
18     );
19    
20 dpavlin 455 sub as_markup {
21 dpavlin 419 my ($self) = @_;
22 dpavlin 448 $self->content_type('application/javascript');
23 dpavlin 455 JSON->new->allow_nonref(1)->encode($self->as_data);
24 dpavlin 419 }
25    
26     1;

  ViewVC Help
Powered by ViewVC 1.1.26