Froody::API - Base class for API definition


Froody documentation Contained in the Froody distribution.

Index


Code Index:

NAME

Top

Froody::API - Base class for API definition

SYNOPSIS

Top

  package Project::API;
  use base 'Froody::API';

  # return all things that this API should register with a repository
  sub load { @stuff }

DESCRIPTION

Top

This is the base class for classes that define Froody::Method objects, Froody::ErrorType objects and all other objects that you register in a repository.

You really shouldn't have to deal with this unless you're creating your Froody::Methods by hand. In most cases you'll use the Froody::API::XML subclass of this.

METHODS

Top

load()

Called by define. Subclass must override this method to return a list of objects that we should register with the API some how. Currently we expect this list to contain Froody::Method or Froody::ErrorType subclasses, and then everything else is ignored.

NOTE: load() should return a new instance of the objects each time the method is called rather than the same one. This is to prevent bad things happening if you have more than one repository and they're using different implementations etc.

BUGS

Top

The current implementation of get_methods and get_errortypes doesn't do anything clever, and therefore calls load twice. We should refactor so this isn't the case.

Please report any bugs you find via the CPAN RT system. http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Froody

AUTHOR

Top

Copyright Fotango 2005. All rights reserved.

Please see the main Froody documentation for details of who has worked on this project.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Top

Froody, Froody::Method


Froody documentation Contained in the Froody distribution.
package Froody::API;
use base qw(Froody::Base);

use strict;
use warnings;

sub load {
  Froody::Error->throw("perl.methodcall.unimplemented", "load must be implemented.");
}

1;