Changeset 11225

Show
Ignore:
Timestamp:
05/07/08 01:35:22 (5 years ago)
Author:
yappo
Message:

add requires_with_attributes method on moosenize

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Class-Component/trunk/lib/Class/Component/Component/Moosenize.pm

    r11210 r11225  
    3434    my $pkg = shift; 
    3535 
    36     for my $method (qw/ requires with /) { 
     36    for my $method (qw/ requires requires_with_attributes with /) { 
    3737        no strict 'refs'; 
    3838        *{"$pkg\::$method"} = sub { unshift @_, $pkg; goto &$method }; 
     
    171171    } 
    172172} 
     173sub requires_with_attributes { 
     174    my $caller     = shift; 
     175    my $attributes = shift; 
     176    requires($caller => map { $_ => $attributes } @_ ); 
     177} 
    173178 
    174179sub with {