view Lib/IMPL/Object/Meta.pm @ 167:1f7a6d762394

SQL schema in progress
author sourcer
date Thu, 12 May 2011 08:57:19 +0400
parents 4267a2ac3d46
children d1676be8afcc
line wrap: on
line source

package IMPL::Object::Meta;
use strict;
use warnings;

use parent qw(IMPL::Object);
use IMPL::Class::Property;
use IMPL::Class::Property::Direct;

BEGIN {
    public _direct property Container => prop_get | owner_set;
}

sub meta {
    my $class = shift;
    my $caller = caller;
    my $meta = $class->surrogate();
    $meta->IMPL::Object::Meta::Container(scalar caller);
    $meta->callCTOR(@_);
    $caller->set_meta($meta);
}

1;

__END__

=pod

=head1 SYNOPSIS

package Foo;

meta BarAttribute('Simple bar attribute'); #mark Foo with BarAttribute

=head1 DESCRIPTION

Базовый класс для мета-свойств класса. Определяет оператор C< meta > для создания метаданных в вызвавшем классе.

=head1 MEMBERS

=over

=item C< Container >

Свойство заполняется до вызова конструктора и содержит имя модуля к которому применяется атрибут.

=back

=cut