Mercurial > pub > Impl
comparison Lib/IMPL/Object/Meta.pm @ 63:76b878ad6596
Added serialization support for the IMPL::Object::List
More intelligent Exception message
Fixed encoding support in the actions
Improoved tests
Minor fixes
author | wizard |
---|---|
date | Mon, 15 Mar 2010 02:38:09 +0300 |
parents | 16ada169ca75 |
children | 42fbb38d4a48 |
comparison
equal
deleted
inserted
replaced
62:c64bd1bf727d | 63:76b878ad6596 |
---|---|
5 use base qw(IMPL::Object); | 5 use base qw(IMPL::Object); |
6 use IMPL::Class::Property; | 6 use IMPL::Class::Property; |
7 use IMPL::Class::Property::Direct; | 7 use IMPL::Class::Property::Direct; |
8 | 8 |
9 BEGIN { | 9 BEGIN { |
10 public _direct property Container => prop_get; | 10 public _direct property Container => prop_get | owner_set; |
11 } | 11 } |
12 | 12 |
13 sub meta { | 13 sub meta { |
14 my $class = shift; | 14 my $class = shift; |
15 my $caller = caller; | 15 my $caller = caller; |
16 my $meta = $class->surrogate(); | 16 my $meta = $class->surrogate(); |
17 $meta->{$Container} = $caller; | 17 $meta->IMPL::Object::Meta::Container(caller); |
18 $meta->callCTOR(@_); | 18 $meta->callCTOR(@_); |
19 $caller->set_meta($meta); | 19 $caller->set_meta($meta); |
20 } | 20 } |
21 | 21 |
22 1; | |
22 | 23 |
23 1; | 24 __END__ |
25 | |
26 =pod | |
27 | |
28 =head1 SYNOPSIS | |
29 | |
30 package Foo; | |
31 | |
32 meta BarAttribute('Simple bar attribute'); #mark Foo with BarAttribute | |
33 | |
34 =head1 DESCRIPTION | |
35 | |
36 Базовый класс для мета-свойств класса. Определяет оператор C< meta > для создания метаданных в вызвавшем классе. | |
37 | |
38 =head1 MEMBERS | |
39 | |
40 =over | |
41 | |
42 =item C< Container > | |
43 | |
44 Свойство заполняется до вызова конструктора и содержит имя модуля к которому применяется атрибут. | |
45 | |
46 =back | |
47 | |
48 =cut |