]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole.pm
Accessors for everything
[maypole.git] / lib / Maypole.pm
index cce6cd7d745aa64847af277d0ce3cbdb8f574064..dd9ff770a1827ca393dd4361509222461135f1b7 100644 (file)
@@ -5,11 +5,11 @@ use UNIVERSAL::require;
 use strict;
 use warnings;
 use Maypole::Config;
-our $VERSION = "1.8";
+our $VERSION = '2.0';
 __PACKAGE__->mk_classdata($_) for qw( config init_done view_object );
 __PACKAGE__->mk_accessors(
-    qw( ar params query objects model_class
-      args action template )
+    qw( ar params query objects model_class template_args output path
+      args action template error document_encoding content_type table)
 );
 __PACKAGE__->config( Maypole::Config->new() );
 __PACKAGE__->init_done(0);
@@ -45,8 +45,9 @@ sub init {
     my $config = $class->config;
     $config->view || $config->view("Maypole::View::TT");
     $config->view->require;
-    die "Couldn't load the view class ".$config->view.": $@" if $@;
-    $config->display_tables || $config->display_tables([ $class->config->tables ]);
+    die "Couldn't load the view class " . $config->view . ": $@" if $@;
+    $config->display_tables
+      || $config->display_tables( [ $class->config->tables ] );
     $class->view_object( $class->config->view->new );
     $class->init_done(1);
 
@@ -66,6 +67,7 @@ sub handler {
     return $status;
 }
 
+# The root of all evil
 sub handler_guts {
     my $r = shift;
     $r->model_class( $r->config->model->class_of( $r, $r->{table} ) );
@@ -123,8 +125,8 @@ sub handler_guts {
 sub is_applicable {
     my $self   = shift;
     my $config = $self->config;
-    $config->ok_tables || $config->ok_tables($config->display_tables);
-    $config->ok_tables ({ map { $_ => 1 } @{ $config->ok_tables } })
+    $config->ok_tables || $config->ok_tables( $config->display_tables );
+    $config->ok_tables( { map { $_ => 1 } @{ $config->ok_tables } } )
       if ref $config->ok_tables eq "ARRAY";
     warn "We don't have that table ($self->{table})"
       if $self->debug
@@ -342,8 +344,8 @@ Simon Cozens, C<simon@cpan.org>
 
 =head1 THANK YOU
 
-Jesse Scheidlower, Jody Belka, Marcus Ramberg, Mickael Joanne, Simon Flack,
-Veljko Vidovic and all the others who've helped.
+Danijel Milicevic, Jesse Scheidlower, Jody Belka, Marcus Ramberg,
+Mickael Joanne, Simon Flack, Veljko Vidovic and all the others who've helped.
 
 =head1 LICENSE