changes so far for new moose / mop
[catagits/Reaction.git] / lib / Reaction / Meta / InterfaceModel / Object / Class.pm
1 package Reaction::Meta::InterfaceModel::Object::Class;
2
3 use aliased 'Reaction::Meta::InterfaceModel::Object::ParameterAttribute';
4 use aliased 'Reaction::Meta::InterfaceModel::Object::DomainModelAttribute';
5
6 use Reaction::Class;
7
8 class Class is 'Reaction::Meta::Class', which {
9
10   around initialize => sub {
11     my $super = shift;
12     my $class = shift;
13     my $pkg   = shift;
14     $super->($class, $pkg, attribute_metaclass => ParameterAttribute, @_);
15   };
16
17   implements add_domain_model => as{
18     my $self = shift;
19     $self->add_attribute( DomainModelAttribute->new(@_) );
20   };
21
22   implements parameter_attributes => as {
23     my $self = shift;
24     return grep { $_->isa(ParameterAttribute) } 
25       $self->compute_all_applicable_attributes;
26   };
27
28   implements domain_models => as {
29     my $self = shift;
30     return grep { $_->isa(DomainModelAttribute) } 
31       $self->compute_all_applicable_attributes;
32   };
33
34 };
35   
36 1;
37
38 =head1 NAME
39
40 Reaction::Meta::InterfaceModel::Object::Class
41
42 =head1 DESCRIPTION
43
44 =head1 METHODS
45
46 =head2 add_domain_model
47
48 =head2 domain_models
49
50 =head2 parameter_attributes
51
52 =head1 AUTHORS
53
54 See L<Reaction::Class> for authors.
55
56 =head1 LICENSE
57
58 See L<Reaction::Class> for the license.
59
60 =cut