/[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 589 by dpavlin, Fri Nov 28 13:27:34 2008 UTC revision 590 by dpavlin, Fri Nov 28 16:35:59 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                    $instance = $class->new( %$params ) or confess "can't $class->new".dump( %$params );
223                    warn "new_frey_class $class";
224            }
225    
226          if ( $instance->can('data') && ! $instance->can('as_data') ) {          if ( $instance->can('data') && ! $instance->can('as_data') ) {
227                  Frey::Role::as_data->meta->apply( $instance );                  Frey::Role::as_data->meta->apply( $instance );
228                  warn "# apply as_data role to $class";                  warn "# apply as_data role to $class";

Legend:
Removed from v.589  
changed lines
  Added in v.590

  ViewVC Help
Powered by ViewVC 1.1.26