Group
Extension

Matches 3

Poet ( J/JS/JSWARTZ/Poet-0.13.tar.gz, JSWARTZ, 2012; MetaCPAN )
Poet/lib/Poet/Mason.pm ( view source; MetaCPAN )
_json ($data)

Output the JSON-encoded I<$data>, set the content type to "application/json",
and abort. e.g.

    method handle {
        my $data;
        # compute data somehow
        $m->send_json
($data);
    }

C<send_json> is a shortcut for

    $m->clear_buffer;
    $m->print(JSON::XS::encode_json($data));
    $m->res->content_type("application/json");
    $m->abort();

=back

=head1 SEE AL
Poet ( J/JS/JSWARTZ/Poet-0.13.tar.gz, JSWARTZ, 2012; MetaCPAN )
Poet/lib/Poet/Mason/Plugin/Request.pm ( view source; MetaCPAN )
RSION = '0.13';
}
use Mason::PluginRole;
use Poet qw($conf $poet);
use Poet::Plack::Response;
use JSON::XS;
use Try::Tiny;

has 'req' => ( is => 'ro', required => 1, isa => 'Object' );
has 'res' => ( 
elf->req->session;
}

method send_json ($data) {
    $self->clear_buffer;
    $self->print( JSON::XS::encode_json($data) );
    $self->res->content_type("application/json");
    $self->abort();
}

1;
Poet ( J/JS/JSWARTZ/Poet-0.13.tar.gz, JSWARTZ, 2012; MetaCPAN )
Poet/lib/Poet/t/Log.pm ( view source; MetaCPAN )
:Log;
BEGIN {
  $Poet::t::Log::VERSION = '0.13';
}
use Poet::Tools qw(rmtree tempdir_simple);
use JSON::XS;
use Test::Class::Most parent => 'Poet::Test::Class';

__PACKAGE__->initialize_temp_env();

s
   my $log_conf = Poet::Log->generate_log4perl_config();
        is( $log_conf, $expected, encode_json($conf_settings) );
    };

    my $default_layout = "%d{dd/MMM/yyyy:HH:mm:ss.SS} [%p] %c - %m - %

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.