Mercurial > pub > Impl
diff Lib/IMPL/Class/Member.pm @ 278:4ddb27ff4a0b
core refactoring
author | cin |
---|---|
date | Mon, 04 Feb 2013 02:10:37 +0400 |
parents | 6585464c4664 |
children |
line wrap: on
line diff
--- a/Lib/IMPL/Class/Member.pm Fri Feb 01 16:37:59 2013 +0400 +++ b/Lib/IMPL/Class/Member.pm Mon Feb 04 02:10:37 2013 +0400 @@ -1,7 +1,7 @@ package IMPL::Class::Member; use strict; use parent qw(Exporter); -our @EXPORT = qw(&public &private &protected); +our @EXPORT = qw(&public &private &protected &_direct); use IMPL::Const qw(:access); @@ -11,22 +11,28 @@ sub public($) { my $info = shift; $info->{access} = ACCESS_PUBLIC; - my ($class,$implementor) = delete $info->{'class','-implementor'}; - $class->$implementor($info); + my $implementor = delete $info->{implementor}; + $implementor->Implement($info); } sub private($) { my $info = shift; $info->{access} = ACCESS_PRIVATE; - my ($class,$implementor) = delete $info->{'class','-implementor'}; - $class->$implementor($info); + my $implementor = delete $info->{implementor}; + $implementor->Implement($info); } sub protected($) { my $info = shift; $info->{access} = ACCESS_PROTECTED; - my ($class,$implementor) = delete $info->{'class','-implementor'}; - $class->$implementor($info); + my $implementor = delete $info->{implementor}; + $implementor->Implement($info); +} + +sub _direct($) { + my $info = shift; + $info->{direct} = 1; + return $info; } 1;