view Lib/IMPL/Class/Member.pm @ 280:c6d0f889ef87

+IMPL::declare now supports meta attributes *bugfixes related to the typeof() operator
author cin
date Wed, 06 Feb 2013 02:15:48 +0400
parents 4ddb27ff4a0b
children
line wrap: on
line source

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;