Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-kimoto committed Dec 15, 2009
1 parent ddd35c7 commit efb2f16
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/Object/Simple/Util.pm
Expand Up @@ -3,6 +3,20 @@ use strict;
use warnings;
use Carp 'croak';

sub import {
my ($class, @functions) = shift;

my $util = 'Object::Simple::Util';

foreach my $function (@functions) {
croak "'$function' not exists in $util"
unless $util->can($function);

no strict 'refs';
*{"${class}::$function"} = sub { $util->$function(@_) };
}
}

sub class_infos { $Object::Simple::CLASS_INFOS };

# Get leftmost self and parent classes
Expand Down

0 comments on commit efb2f16

Please sign in to comment.