ta;
$Net::Stripe::Simple::Data::VERSION = '0.005';
# ABSTRACT: collection of methods to augment a JSON hash
use v5.10;
use strict;
use warnings;
use Scalar::Util qw(refaddr);
use overload '""' =>
f =~ /^JSON/) {
return "$v";
} else {
return $v;
}
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Net::Stripe::Simple::Data - collection of methods to augment a JSON hash
# and another
}
);
=head1 DESCRIPTION
L<Net::Stripe::Simple::Data> is simply a L<JSON> hash with a little magic added
to it. Principally, it will autoload any attribute name into an a
se64 qw(encode_base64);
use URI::Escape qw(uri_escape);
use Scalar::Util qw(reftype blessed);
use JSON ();
use Devel::StackTrace;
use Net::Stripe::Simple::Data;
use Net::Stripe::Simple::Error;
our @
equest($req);
}
# implements PHP convention for encoding "dictionaries" (why don't they accept
# json bodies in posts?)
sub _encode_params {
my $args = shift;
my @components;
for my $key
$value = # JSON boolean stringification magic has been erased
blessed $value && $value->isa(ref(true())) # hack to work around inheritance issues with JSON booleans
License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
=head1 SEE ALSO
L<Template::Flute::Iterator::JSON>
=cut
1;
ackage Template::Flute::Filter::JsonVar;
use strict;
use warnings;
use base 'Template::Flute::Filter';
use JSON;
=head1 NAME
Template::Flute::Filter::JsonVar - JSON to Javascript variable filter
structure or a JSON string and returns Javascript
which parses the JSON string with Jquery and assigns it to
the variable C<json>.
The following example shows you how to inject the JSON variable
into
t/javascript" id="vars"></script>
XML Specification:
<value name="jsvars" id="vars" filter="json_var"/>
Values for L<Template::Flute>:
Template::Flute->new(...,
values => {jsvars =
tablish /.well-known/host-meta route
my $route = $app->routes->any( $WK_PATH => [format => [qw!json xml jrd xrd!]] );
# Define endpoint
$route->endpoint('host-meta');
# Set route callb
renderer->default_format('json');
my $data;
if ($self->tx->req->body) {
require JSON::XS;
$data = eval{JSON::XS::decode_json($self->tx->req->body)};
if ($@) {
$self->render(json => {
error => $@
},
foo} eq 'bar') {
$self->render(json => {
error => "Can not find key 'foo' with value 'bar' in JSON body",
}
package App::Glacier::DB;
use strict;
use warnings;
use JSON;
use Carp;
use App::Glacier::Timestamp;
use parent 'Exporter';
use constant {
ENCODE => 0,
DECODE => 1
};
my %transcode = (
'
ecoder
\&Storable::thaw
],
'json' => [
# Encoder
sub { JSON->new->convert_blessed(1)->encode(shift) },
# Decoder
sub { JSON->
new->
filter_json_object(sub { timestamp_deserialize
:Plugin::API::VERSION = '5.0.2';
use warnings;
use strict;
use 5.010;
use Mojolicious::Lite;
use JSON::XS;
use Tapper::Cmd::Testplan;
use Tapper::Cmd::Host;
use Tapper::Cmd::Testrun;
use Tapper::Mode
my $room = $self->param('room');
my $ip = $self->param('ip');
$self->render(json => {id => 12}, status => 201);
};
put 'host-new/name/:name' => sub {
my $self = shift;
$self->render(json => {id => 12}, status => 201);
};
put 'testrun-start/:testrun' => sub {
my $self = shift;
$self->app->renderer->default_format('json');
my $data;
lf) if ref($fmt) eq 'CODE';
return $self->strftime($fmt);
} else {
croak "unknown canned format $fmt"
}
}
sub TO_JSON {
my $self = shift;
return $self->canned_format('standard');
}
=> $FindBin::Bin
},
]);
Plack::Middleware::JSONP
$self->plugin('plack_middleware', [
JSONP => {callback_key => 'json.p'},
]);
=head1 AUTHOR
Sugama Keita, E<lt>sugama@j
=> { default => 72000, check => \&App::Glacier::Command::ck_number },
encoding => { default => 'json' }
);
sub configtest {
my ($class, $cfg, @path) = @_;
$cfg->lint(\%lexicon, @path);
}
#
cier::HttpCatch;
use App::Glacier::Signature;
use Carp;
use version 0.77;
use LWP::UserAgent;
use JSON;
sub new {
my ($class, %opts) = @_;
my $region = (delete $opts{region} || _get_instore_r
. $istore_document_path);
unless ($response->is_success) {
return undef;
}
my $doc = JSON->new->decode($response->decoded_content);
return $doc->{region};
}
sub _get_instore_creds {
esponse = $ua->get($url);
unless ($response->is_success) {
return undef;
}
my $doc = JSON->new->decode($response->decoded_content);
return ($doc->{AccessKeyId}, $doc->{SecretAccessKey
egrationtest::VERSION = '5.0.2';
use warnings;
use strict;
use 5.010;
use Mojolicious::Lite;
use JSON::XS;
use Tapper::Cmd::Testplan;
use Tapper::Cmd::Host;
use Tapper::Cmd::Testrun;
use Tapper::Mode
my $room = $self->param('room');
my $ip = $self->param('ip');
$self->render(json => {id => 12}, status => 201);
};
put 'host-new/name/:name' => sub {
my $self = shift;
$self->render(json => {id => 12}, status => 201);
};
put 'testrun-start/:testrun' => sub {
my $self = shift;
$self->app->renderer->default_format('json');
my $data;
=> $FindBin::Bin
},
]);
Plack::Middleware::JSONP
$self->plugin('plack_middleware', [
JSONP => {callback_key => 'json.p'},
]);
=head1 AUTHOR
Sugama Keita, E<lt>sugama@j
s;
use Mojo::Base -base;
use Mojo::JSON qw(encode_json);
our $VERSION = '2.01';
has 'draw';
has 'records_total';
has 'records_filtered';
has 'data';
sub TO_JSON {
my ($self) = @_;
return
lugin('DataTables');
# Mojolicious::Lite
plugin 'DataTables';
[...]
$c->render(json => $c->datatable->ssp_results(
draw => 1,
data => \@resul
wing methods.
=head2 draw
=head2 records_total
=head2 records_filtered
=head2 data
=head2 TO_JSON
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>, L<Mojolici
ge Mojolicious::Plugin::DataTables;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::JSON qw(decode_json encode_json true false);
use Mojo::Collection;
use Mojo::DOM::HTML;
use Mojo::ByteStream;
use M
DO
if ($debug) {
$log->debug("Query: $stmt");
$log->debug( "Bind: " . encode_json \@bind );
}
my $query = $sql->db->query( $stmt, @bind );
my @results = ();
whi
$log->debug( "Bind Total: " . encode_json \@bind_total );
$log->debug("Query Filtered: $stmt_filter");
$log->debug( "Bind Filtered: " . encode_json \@bind_filter );
}
my $tota
package
Twitter::Text::Configuration; # hide from PAUSE
use strict;
use warnings;
use JSON ();
use Path::Tiny qw(path);
use File::Share qw(dist_file);
# internal use only, do not use this module
che{$config_name};
return $config_cache{$config_name} ||= JSON::decode_json(path(dist_file('Twitter-Text', "config/$config_name.json"))->slurp);
}
sub V1 {
return configuration_from_file('v1
my $jid = $self->glacier->Initiate_inventory_retrieval(
$self->vault,
'JSON',
"Inventory retrieval for vault ".$self->vault
);
if ($self->glaci
y as possible. This "simple"
structure could be shared TT implementations in other languages
via JSON or YAML. You can optionally enable generating Perl code by
setting COMPILE_PERL = 1.
=item
All
The AST is composed
only of scalars and arrayrefs and is suitable for sending to
JavaScript via JSON or sharing with other languages. The parse_tree
method is used for returning this AST.
Once at