Mercurial > pub > Impl
diff Lib/IMPL/Class/Property.pm @ 278:4ddb27ff4a0b
core refactoring
author | cin |
---|---|
date | Mon, 04 Feb 2013 02:10:37 +0400 |
parents | 8a5da17d7ef9 |
children |
line wrap: on
line diff
--- a/Lib/IMPL/Class/Property.pm Fri Feb 01 16:37:59 2013 +0400 +++ b/Lib/IMPL/Class/Property.pm Mon Feb 04 02:10:37 2013 +0400 @@ -9,7 +9,7 @@ use IMPL::lang qw(:hash); use IMPL::Const qw(:prop); use Carp qw(carp); -require IMPL::Class::Memeber; +require IMPL::Class::Member; sub import { __PACKAGE__->export_to_level(1,@_); @@ -26,16 +26,12 @@ sub property($$) { my ($propName,$attributes) = @_; - $attributes = { - get => $attributes & PROP_GET, - set => $attributes & PROP_SET, - isList => $attributes & PROP_LIST - } unless ref $attributes; - + my $class = caller; + return hashMerge ( - $attributes, + $class->ClassPropertyImplementor->NormalizeSpecification($attributes), { - -implementor => 'ImplementProperty', + implementor => $class->ClassPropertyImplementor, name => $propName, class => scalar(caller), } @@ -43,11 +39,17 @@ } sub CreateProperty { - my ($class,$propName,$attributes) = @_; + my ($class,$propName,@attributes) = @_; - carp "Using create property is deprecated, use ImplementProperty instead"; - - $class->ImplementProperty($propName,$attributes); + $class + ->ClassPropertyImplementor + ->Implement( + @attributes, + { + name => $propName, + class => $class, + } + ); }; 1;