/[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 581 by dpavlin, Thu Nov 27 21:32:36 2008 UTC revision 582 by dpavlin, Fri Nov 28 13:18:18 2008 UTC
# Line 168  sub class_methods { Line 168  sub class_methods {
168    
169  sub class_runnable {  sub class_runnable {
170          my ( $self, $class ) = @_;          my ( $self, $class ) = @_;
171          my @methods = grep { m{^as_} } $self->class_methods( $class );          my @methods = grep { m{^as_} || m{_as_} } $self->class_methods( $class );
172          return @methods if wantarray;          return @methods if wantarray;
173          return \@methods;          return \@methods;
174  }  }
# Line 215  sub new_frey_class { Line 215  sub new_frey_class {
215          my $instance = $class->new( %$params );          my $instance = $class->new( %$params );
216          if ( $instance->can('data') && ! $instance->can('as_data') ) {          if ( $instance->can('data') && ! $instance->can('as_data') ) {
217                  Frey::Role::as_data->meta->apply( $instance );                  Frey::Role::as_data->meta->apply( $instance );
218                  warn "# apply as_data role to $class";                  $self->TODO("apply as_data role to $class");
219          }          }
220          if ( $instance->can('sponge') && ! $instance->can('as_sponge') ) {          if ( $instance->can('sponge') && ! $instance->can('as_sponge') ) {
221                  Frey::Role::as_sponge->meta->apply( $instance );                  Frey::Role::as_sponge->meta->apply( $instance );
222                  warn "# apply as_sponge role to $class";                  $self->TODO("apply as_sponge role to $class");
223          }          }
224    
225          $self->add_status({ $class => $params }) if $self->can('add_status');          if ( ! $instance->can('add_status') ) {
226                    Frey::Web->meta->apply( $instance );
227                    $self->TODO("apply Frey::Web role to $class");
228            }
229    
230            if ( $self->can('add_status') ) {
231                    $self->add_status({ $class => $params });
232            } else {
233                    warn "# class $self can't add_status";
234            }
235          return $instance;          return $instance;
236  }  }
237    

Legend:
Removed from v.581  
changed lines
  Added in v.582

  ViewVC Help
Powered by ViewVC 1.1.26