--- trunk/lib/Frey.pm 2008/07/08 12:18:33 58 +++ trunk/lib/Frey.pm 2008/11/27 22:29:34 572 @@ -1,9 +1,11 @@ package Frey; use Moose; +our $VERSION = "0.22"; + has 'debug' => ( is => 'rw', - isa => 'Bool', + isa => 'Int', default => 0, ); @@ -18,30 +20,41 @@ The Norse god who dispenses peace, good weather, prosperity, and bountiful crops; the brother of Freya. -=cut +Basically you write L classes which become deirectly callable from +the web using REST API -use Data::Dump qw/dump/; -use File::Find; +=head1 INTROSPECTION -has 'classes' => ( - is => 'ro', -# isa => 'HashRef[Str]', - default => sub { - my $self = shift; - # FIXME there must be better way to do this in Moose style - my $classes; - finddepth({ no_chdir => 1, wanted => sub { - return unless s/\.pm$//; - my @a = split(m!/!,$_); - warn ">> $_ ",dump( @a ) if $self->debug; - my $package = join('::', @a[ 1 .. $#a ]); - warn "## $package\n"; - push @$classes, { $package => "$_.pm" }; - } }, 'lib'); - warn "## classes = ",dump( $classes ) if $self->debug; - $classes; - }, - lazy => 1, -); +Secondary goal is to have introspection. + +=head2 Moose classes + +All Moose classes have simple introspection API which use +L to show class and it's pod (using L). + +Example of valid REST URL is + + http://localhost:16001/Frey + +which will show L class introspection. + +You can also add method invocation and optonal parametars to C +constructor like this: + + http://localhost:16001/Frey::Pod/as_markup?class=Frey + +this is same using L from perl as + + Frey::Pod->new( class => 'Frey' )->as_markup; + +if you leave out parametars, L will ask for required ones. + +=head2 Database + +For database objects we support L and when your objects are created +C<< with 'Frey::Collection' >> they will have basic CRUD functionality +implemented by L. + +=cut 1;