comparison lib/IMPL/Class/Member.pm @ 427:09e0086a82a7 ref20150831 tip

Merge
author cin
date Tue, 15 May 2018 00:51:33 +0300
parents eed50c01e758 c27434cdd611
children
comparison
equal deleted inserted replaced
426:eed50c01e758 427:09e0086a82a7
1 package IMPL::Class::Member;
2 use strict;
3 use parent qw(Exporter);
4 our @EXPORT = qw(&public &private &protected &_direct);
5
6
7 use IMPL::Const qw(:access);
8
9 require IMPL::Class::MemberInfo;
10
11 sub public($) {
12 my $info = shift;
13 $info->{access} = ACCESS_PUBLIC;
14 my $implementor = delete $info->{implementor};
15 $implementor->Implement($info);
16 }
17
18 sub private($) {
19 my $info = shift;
20 $info->{access} = ACCESS_PRIVATE;
21 my $implementor = delete $info->{implementor};
22 $implementor->Implement($info);
23 }
24
25 sub protected($) {
26 my $info = shift;
27 $info->{access} = ACCESS_PROTECTED;
28 my $implementor = delete $info->{implementor};
29 $implementor->Implement($info);
30 }
31
32 sub _direct($) {
33 my $info = shift;
34 $info->{direct} = 1;
35 return $info;
36 }
37
38 1;