tweak add_domain_model to default attribute metaclass rather than forcibly construct...
[catagits/Reaction.git] / lib / Reaction / Meta / InterfaceModel / Object / Class.pm
CommitLineData
7adfd53f 1package Reaction::Meta::InterfaceModel::Object::Class;
2
3use aliased 'Reaction::Meta::InterfaceModel::Object::ParameterAttribute';
4use aliased 'Reaction::Meta::InterfaceModel::Object::DomainModelAttribute';
5
6use Reaction::Class;
7
8class 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;
bae339c8 19 my $name = shift;
20 $self->add_attribute($name, metaclass => DomainModelAttribute, @_);
7adfd53f 21 };
22
23 implements parameter_attributes => as {
24 my $self = shift;
25 return grep { $_->isa(ParameterAttribute) }
26 $self->compute_all_applicable_attributes;
27 };
28
29 implements domain_models => as {
30 my $self = shift;
31 return grep { $_->isa(DomainModelAttribute) }
32 $self->compute_all_applicable_attributes;
33 };
34
35};
36
371;
38
39=head1 NAME
40
41Reaction::Meta::InterfaceModel::Object::Class
42
43=head1 DESCRIPTION
44
45=head1 METHODS
46
47=head2 add_domain_model
48
49=head2 domain_models
50
51=head2 parameter_attributes
52
53=head1 AUTHORS
54
55See L<Reaction::Class> for authors.
56
57=head1 LICENSE
58
59See L<Reaction::Class> for the license.
60
61=cut