comparison Lib/IMPL/Class/Property/Direct.pm @ 275:6253872024a4

*refactoring IMPL::Class
author cin
date Thu, 31 Jan 2013 02:18:31 +0400
parents 4d0e1962161c
children
comparison
equal deleted inserted replaced
274:8d36073411b1 275:6253872024a4
16 16
17 my $default = __PACKAGE__->new({ExportField => 1}); 17 my $default = __PACKAGE__->new({ExportField => 1});
18 18
19 sub _direct($) { 19 sub _direct($) {
20 my ($prop_info) = @_; 20 my ($prop_info) = @_;
21 $prop_info->Implementor( $default ); 21 $prop_info->implementor( $default );
22 return $prop_info; 22 return $prop_info;
23 } 23 }
24 24
25 25
26 sub GenerateGet { 26 sub GenerateGet {
70 70
71 { 71 {
72 no strict 'refs'; 72 no strict 'refs';
73 if (ref $self and $self->ExportField) { 73 if (ref $self and $self->ExportField) {
74 my $field = $self->FieldName($propInfo); 74 my $field = $self->FieldName($propInfo);
75 *{$propInfo->Class.'::'.$propInfo->Name} = \$field; 75 *{$propInfo->class.'::'.$propInfo->name} = \$field;
76 } 76 }
77 } 77 }
78 } 78 }
79 79
80 sub FieldName { 80 sub FieldName {
81 my ($self,$propInfo) = @_; 81 my ($self,$propInfo) = @_;
82 82
83 my ($class,$name) = $propInfo->get( qw(Class Name) ); 83 my ($class,$name) = $propInfo->get( qw(class name) );
84 (my $field = "${class}_$name") =~ s/::/_/g; 84 (my $field = "${class}_$name") =~ s/::/_/g;
85 return $field; 85 return $field;
86 } 86 }
87 87
88 1; 88 1;