summary refs log tree commit diff
path: root/lib/MooseX/Net/API/Role/Deserialize.pm
blob: b83c58af139cabfa421887c0d020de384261dd0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package MooseX::Net::API::Role::Deserialize;

use Moose::Role;
use JSON::XS;
use YAML::Syck;
use XML::Simple;

sub _from_json {
    return decode_json( $_[1] );
}

sub _from_yaml {
    return Dump $_[1];
}

sub _from_xml {
    my $xml = XML::Simple->new( ForceArray => 0 );
    $xml->XMLin( $_[1] );
}

1;