Nathanael Anderson > Persevere-Client > Persevere::Client::Class

Download:
Persevere-Client-0.31.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.31   Source  

NAME ^

Persevere::Client::Class - The Class interface to Persevere the JSON Database

SYNOPSIS ^

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}};
  }

METHODS ^

new
        This is called from Persevere::Client->class.
fullname
        Returns a scalar of the name of the class the object refers to, removes trailing slash.
exists
        Returns true if the class the object refers to exists.
create
        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.
delete
        Deletes the class the object refers to.
createObjects
        Creates new objects, takes an array of hashes as input.
updateObjects
        Updates existing objects, takes an array of hashes as input. Hashes must have id's correcly set to update objects.
queryRange
        Queries a range of results from the objects class.
query
        Queries all results from the objects class. 

AUTHOR ^

Nathanael Anderson, <wirelessdreamer at gm]a[il d[0]t com>

BUGS ^

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.

COPYRIGHT & LICENSE ^

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.

syntax highlighting: