PX::API::Response::Rest - A C<PX::API::Response> plugin module.


PX-API documentation Contained in the PX-API distribution.

Index


Code Index:

NAME

Top

PX::API::Response::Rest - A PX::API::Response plugin module.

DESCRIPTION

Top

This plugin is loaded automagically by PX::API::Response when the 'rest' response format is returned from the Peekshows API. XML::Simple is used to parse the xml returned from the API call.

DEPENDENCIES

Top

PX::API::Response XML::Simple

SEE ALSO

Top

PX::API http://www.peekshows.com http://services.peekshows.com

AUTHOR

Top

Anthony Decena <anthony@1bci.com>

LICENCE AND COPYRIGHT

Top


PX-API documentation Contained in the PX-API distribution.

package PX::API::Response::Rest;
use warnings;
use strict;
use Carp;

use version; our $VERSION = qv('0.0.3');

use XML::Simple;

sub new {
	my $class = shift;
	my $args  = shift || {};

	$class = ref($class) || $class;
	my $self = bless {}, $class;
	$self->{'xs'} = XML::Simple->new(KeepRoot => 1, KeyAttr => []);
	return $self;
	}

sub parse {
	my $self = shift;
	my $xml  = shift;

	my $xs = $self->{'xs'};
	my $ref = $xs->XMLin($xml);
	return $ref;
	}

sub format { 'rest' }


1;
__END__