Group
Extension

Matches 17

Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/JSON.pm ( view source; MetaCPAN )
package Net::Fluidinfo::JSON;
use Moose;

use JSON::XS;

has json => (
    is      => 'ro',
    isa     => 'JSON::XS',
    default => sub { JSON::XS->new->utf8->allow_nonref },
    handles => [qw(enco
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Value/Set.pm ( view source; MetaCPAN )
ue::Set;
use Moose;
extends 'Net::Fluidinfo::Value::Native';

sub to_json {
    my $self = shift;
    my @strings = map $self->json->encode("$_"), @{$self->value};
    '[' . join(',', @strings) . ']'
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Object.pm ( view source; MetaCPAN )
_about ? $self->json->encode({about => $self->about}) : undef;
    $self->fin->post(
        path       => $self->abs_path('objects'),
        headers    => $self->fin->headers_for_json,
        paylo
payload,
        on_success => sub {
            my $response = shift;
            my $h = $self->json->decode($response->content);
            $self->_set_id($h->{id});
            # Unset tag paths 
ts,
        headers    => $fin->accept_header_for_json,
        on_success => sub {
            my $response = shift;
            my $h = $class->json->decode($response->content);
            my $o = 
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Value.pm ( view source; MetaCPAN )
:Native->is_mime_type($mime_type)) {
        Net::Fluidinfo::Value::Native->new_from_fin_type_and_json($fin_type, $content);
    } else {
        # instead of ordinary use(), to play nice with inherit
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Base.pm ( view source; MetaCPAN )
package Net::Fluidinfo::Base;
use Moose;

use JSON::XS;
use Carp;

use MooseX::ClassAttribute;
class_has json => (is => 'ro', default => sub { JSON::XS->new->utf8->allow_nonref });

has fin  => (is =>
ub true {
    shift->as_json_boolean(1);
}

sub false {
    shift->as_json_boolean(0);
}

sub as_json_boolean {
    my ($receiver, $flag) = @_;
    $flag ? JSON::XS::true : JSON::XS::false;
}

sub get
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Tag.pm ( view source; MetaCPAN )

    my $self = shift;
    
    my $payload = $self->json->encode({
        description => $self->description,
        indexed     => $self->as_json_boolean($self->indexed),
        name        => $se
ders    => $self->fin->headers_for_json,
        payload    => $payload,
        on_success => sub {
            my $response = shift;
            my $h = $self->json->decode($response->content);
    
ts,
        headers    => $fin->accept_header_for_json,
        on_success => sub {
            my $response = shift;
            my $h = $class->json->decode($response->content);
            my $t = 
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Namespace.pm ( view source; MetaCPAN )
to set description and path of self.
sub create {
    my $self = shift;

    my $payload = $self->json->encode({description => $self->description, name => $self->name});
    $self->fin->post(
        
ders    => $self->fin->headers_for_json,
        payload    => $payload,
        on_success => sub {
            my $response = shift;
            my $h = $self->json->decode($response->content);
    
ts,
        headers    => $fin->accept_header_for_json,
        on_success => sub {
            my $response = shift;
            my $h = $class->json->decode($response->content);
            my $ns =
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Permission.pm ( view source; MetaCPAN )
 },
        headers    => $fin->accept_header_for_json,
        on_success => sub {
            my $response = shift;
            my $h = $class->json->decode($response->content);
            $class->
h
            );
        }
    );
}

sub update {
    my $self = shift;

    my $payload = $self->json->encode({policy => $self->policy, exceptions => $self->exceptions});
    $self->fin->put(
       
path),
        query   => { action => $self->action },
        headers => $self->fin->headers_for_json,
        payload => $payload
    );
}

no Moose;
no MooseX::ClassAttribute;
__PACKAGE__->meta->ma
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/User.pm ( view source; MetaCPAN )
e),
        headers    => $fin->accept_header_for_json,
        on_success => sub {
            my $response = shift;
            my $h = $class->json->decode($response->content);
            my $user
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Value/String.pm ( view source; MetaCPAN )
se Moose;
extends 'Net::Fluidinfo::Value::Native';

sub to_json {
    my $self = shift;
    no warnings; # value may be undef
    $self->json->encode('' . $self->value);
}

no Moose;
__PACKAGE__->meta
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Value/Boolean.pm ( view source; MetaCPAN )
ckage Net::Fluidinfo::Value::Boolean;
use Moose;
extends 'Net::Fluidinfo::Value::Native';

sub to_json {
    my $self = shift;
    $self->value ? 'true' : 'false';
}

no Moose;
__PACKAGE__->meta->make
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Value/Integer.pm ( view source; MetaCPAN )
;
use Moose;
extends 'Net::Fluidinfo::Value::Native';

# A Perl integer is a JSON integer. Sanitize with int().
sub to_json {
    my $self = shift;
    no warnings; # the value may not be an integer i
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Value/Float.pm ( view source; MetaCPAN )
nteger,
# and it won't pick it as float unless you serialise it explicitly as such: "5.0".
sub to_json {
    my $self  = shift;
    no warnings; # value may not be a number
    my $float = 0 + $self->
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Value/Null.pm ( view source; MetaCPAN )
package Net::Fluidinfo::Value::Null;
use Moose;
extends 'Net::Fluidinfo::Value::Native';

sub value {
    undef;
}

sub to_json {
    'null';
}

no Moose;
__PACKAGE__->meta->make_immutable;

1;
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Value/ListOfStrings.pm ( view source; MetaCPAN )
Strings;
use Moose;
extends 'Net::Fluidinfo::Value::Native';

sub to_json {
    my $self = shift;
    my @strings = map $self->json->encode("$_"), @{$self->value};
    '[' . join(',', @strings) . ']';
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo/Value/Native.pm ( view source; MetaCPAN )
luidinfo::Value';

use Carp;
use Net::Fluidinfo::JSON;
use MooseX::ClassAttribute;
class_has json => (is => 'ro', default => sub { Net::Fluidinfo::JSON->new });

# In the future more serialisation for
ddb.value+json';

sub mime_type {
    $MIME_TYPE;
}

sub is_mime_type {
    my ($class, $mime_type) = @_;
    defined $mime_type && $mime_type eq $MIME_TYPE;
}

sub new_from_fin_type_and_json {
    my
 ($class, $fin_type, $json) = @_;
    my $native_class = $class->class_for_fin_type($fin_type);
    $native_class->new(value => $class->json->decode($json));
}

# Fluidinfo types of native values are 
Net-Fluidinfo ( F/FX/FXN/Net-Fluidinfo-0.45.tar.gz, FXN, 2012; MetaCPAN )
Net-Fluidinfo/lib/Net/Fluidinfo.pm ( view source; MetaCPAN )
= 'fluiddb.fluidinfo.com';
our $SANDBOX_HOST      = 'sandbox.fluidinfo.com';
our $JSON_CONTENT_TYPE = 'application/json';

has protocol => (is => 'rw', isa => 'Str', default => $DEFAULT_PROTOCOL);
has
s_for_json {
    return {
        'Accept'       => $JSON_CONTENT_TYPE,
        'Content-Type' => $JSON_CONTENT_TYPE
    };
}

sub accept_header_for_json {
    return {
        'Accept' => $JSON_CONTE
NT_TYPE
    }
}

sub content_type_header_for_json {
    return {
        'Content-Type' => $JSON_CONTENT_TYPE
    }
}

#
# -- Convenience shortcuts ----------------------------------------------------

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