Mercurial > pub > Impl
diff lib/IMPL/Class/Member.pm @ 407:c6e90e02dd17 ref20150831
renamed Lib->lib
author | cin |
---|---|
date | Fri, 04 Sep 2015 19:40:23 +0300 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/IMPL/Class/Member.pm Fri Sep 04 19:40:23 2015 +0300 @@ -0,0 +1,38 @@ +package IMPL::Class::Member; +use strict; +use parent qw(Exporter); +our @EXPORT = qw(&public &private &protected &_direct); + + +use IMPL::Const qw(:access); + +require IMPL::Class::MemberInfo; + +sub public($) { + my $info = shift; + $info->{access} = ACCESS_PUBLIC; + my $implementor = delete $info->{implementor}; + $implementor->Implement($info); +} + +sub private($) { + my $info = shift; + $info->{access} = ACCESS_PRIVATE; + my $implementor = delete $info->{implementor}; + $implementor->Implement($info); +} + +sub protected($) { + my $info = shift; + $info->{access} = ACCESS_PROTECTED; + my $implementor = delete $info->{implementor}; + $implementor->Implement($info); +} + +sub _direct($) { + my $info = shift; + $info->{direct} = 1; + return $info; +} + +1;