/[Frey]/trunk/lib/Frey/ClassLoader.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/ClassLoader.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 586 by dpavlin, Fri Nov 28 13:27:34 2008 UTC revision 653 by dpavlin, Sun Nov 30 23:49:32 2008 UTC
# Line 212  It is used by L<Frey::Run> and L<Frey::P Line 212  It is used by L<Frey::Run> and L<Frey::P
212    
213  sub new_frey_class {  sub new_frey_class {
214          my ( $self, $class, $params ) = @_;          my ( $self, $class, $params ) = @_;
215          my $instance = $class->new( %$params );          my $instance;
216            
217            if ( $class->meta->isa('Moose::Meta::Role') ) {
218                    $instance = Frey->new;
219                    Frey::Web->meta->apply( $instance );
220                    warn "new_frey_class $class role with Frey::Web";
221            } else {
222                    $params->{request_url} = $self->request_url;
223                    $instance = $class->new( %$params ) or confess "can't $class->new".dump( %$params );
224                    warn "new_frey_class $class";
225            }
226    
227          if ( $instance->can('data') && ! $instance->can('as_data') ) {          if ( $instance->can('data') && ! $instance->can('as_data') ) {
228                  Frey::Role::as_data->meta->apply( $instance );                  Frey::Role::as_data->meta->apply( $instance );
229                  warn "# apply as_data role to $class";                  warn "# apply as_data role to $class";

Legend:
Removed from v.586  
changed lines
  Added in v.653

  ViewVC Help
Powered by ViewVC 1.1.26