Mercurial > pub > Impl
diff Lib/IMPL/Class/Member.pm @ 276:8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
author | sergey |
---|---|
date | Thu, 31 Jan 2013 17:37:44 +0400 |
parents | 6253872024a4 |
children | 6585464c4664 |
line wrap: on
line diff
--- a/Lib/IMPL/Class/Member.pm Thu Jan 31 02:18:31 2013 +0400 +++ b/Lib/IMPL/Class/Member.pm Thu Jan 31 17:37:44 2013 +0400 @@ -3,31 +3,30 @@ use parent qw(Exporter); our @EXPORT = qw(virtual public private protected); + +use IMPL::Const qw(:access); + use IMPL::Class::Meta; require IMPL::Class::MemberInfo; -#TODO: remove -use constant { - MOD_PUBLIC => 1, - MOD_PROTECTED => 2, - MOD_PRIVATE => 3 -}; - sub public($) { - $_[0]->access(MOD_PUBLIC); - $_[0]->Implement; - $_[0]; + my $info = shift; + $info->{access} = ACCESS_PUBLIC; + my ($class,$implementor) = delete $info->{'class','-implementor'}; + $class->$implementor($info); } sub private($) { - $_[0]->access(MOD_PRIVATE); - $_[0]->Implement; - $_[0]; + my $info = shift; + $info->{access} = ACCESS_PRIVATE; + my ($class,$implementor) = delete $info->{'class','-implementor'}; + $class->$implementor($info); } sub protected($) { - $_[0]->access(MOD_PROTECTED); - $_[0]->Implement; - $_[0]; + my $info = shift; + $info->{access} = ACCESS_PROTECTED; + my ($class,$implementor) = delete $info->{'class','-implementor'}; + $class->$implementor($info); } 1;