Persevere::Client::Class - The Class interface to Persevere the JSON Database
This module provides an interface to the classes in persevere
$persvr = Persevere::Client->new( host => "localhost", port => "8080", auth_type => "basic", username => "test", password => "pass" ); %hash1 = ("name1" => "test1", "type" => "odd"); %hash2 = ("name2" => "test2", "type" => "even"); push @post_data, \%hash1; push @post_data, \%hash2; # createObjects and updateObjects require and array of hashes $postreq = $initialclass->createObjects(\@post_data); $datareq = $initialclass->query("[?type='even']"); # query returns an array of hashes if ($datareq->{success}){ # array of hashes @data = @{$datareq->{data}}; }
This is called from Persevere::Client->class.
Returns a scalar of the name of the class the object refers to, removes trailing slash.
Returns true if the class the object refers to exists.
Creates the class the object refers to. calling $persvr->class("classname"); does not create a class, it only creates an object that refers to the class, calling create on that object creates the actual class.
Deletes the class the object refers to.
Creates new objects, takes an array of hashes as input.
Updates existing objects, takes an array of hashes as input. Hashes must have id's correcly set to update objects.
Queries a range of results from the objects class.
Queries all results from the objects class.
Nathanael Anderson, <wirelessdreamer at gm]a[il d[0]t com>
<wirelessdreamer at gm]a[il d[0]t com>
Please report any bugs or feature requests to bug-persevere-client at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Persevere-Client. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-persevere-client at rt.cpan.org
Copyright 2009-2011 Nathanael Anderson.
s program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Persevere::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Persevere::Client
CPAN shell
perl -MCPAN -e shell install Persevere::Client
For more information on module installation, please visit the detailed CPAN module installation guide.