Mercurial > pub > Impl
comparison Lib/IMPL/Class/Meta.pm @ 230:6d8092d8ce1b
*reworked IMPL::Security
*reworked IMPL::Web::Security
*refactoring
author | sergey |
---|---|
date | Mon, 08 Oct 2012 03:37:37 +0400 |
parents | 47f77e6409f7 |
children | 0f59b2de72af |
comparison
equal
deleted
inserted
replaced
229:47f77e6409f7 | 230:6d8092d8ce1b |
---|---|
85 no strict 'refs'; | 85 no strict 'refs'; |
86 | 86 |
87 *{"${class}::${name}"} = sub { | 87 *{"${class}::${name}"} = sub { |
88 my $self = shift; | 88 my $self = shift; |
89 | 89 |
90 $self = ref $self || $self; | |
91 | |
90 if (@_ > 0) { | 92 if (@_ > 0) { |
91 $self = ref $self || $self; | |
92 | |
93 if ($class ne $self) { | 93 if ($class ne $self) { |
94 $self->static_accessor_clone( $name => $_[0] ); # define own class data | 94 $self->static_accessor_clone( $name => $_[0] ); # define own class data |
95 } else { | 95 } else { |
96 $value = $_[0]; | 96 $value = $_[0]; |
97 } | 97 } |
98 } else { | 98 } else { |
99 $self->static_accessor_clone($name => clone($value)); | 99 return $self ne $class |
100 ? $self->static_accessor_clone($name => clone($value)) | |
101 : $value; | |
100 } | 102 } |
101 }; | 103 }; |
102 $value | 104 return $value; |
103 }; | 105 }; |
104 | 106 |
105 sub static_accessor_inherit { | 107 sub static_accessor_inherit { |
106 my ($class,$name,$value) = @_; | 108 my ($class,$name,$value) = @_; |
107 | 109 |
119 $value = $_[0]; | 121 $value = $_[0]; |
120 } | 122 } |
121 } else { | 123 } else { |
122 $value ; | 124 $value ; |
123 } | 125 } |
124 } | 126 }; |
127 return $value; | |
125 } | 128 } |
126 | 129 |
127 sub static_accessor_own { | 130 sub static_accessor_own { |
128 my ($class,$name,$value) = @_; | 131 my ($class,$name,$value) = @_; |
129 | 132 |
143 $value = $_[0]; | 146 $value = $_[0]; |
144 } else { | 147 } else { |
145 return $value; | 148 return $value; |
146 } | 149 } |
147 } | 150 } |
148 } | 151 }; |
152 | |
153 return $value; | |
149 } | 154 } |
150 | 155 |
151 sub _find_class_data { | 156 sub _find_class_data { |
152 my ($class,$name) = @_; | 157 my ($class,$name) = @_; |
153 | 158 |