Commit | Line | Data |
7adfd53f |
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; |
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 | |
37 | 1; |
38 | |
39 | =head1 NAME |
40 | |
41 | Reaction::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 | |
55 | See L<Reaction::Class> for authors. |
56 | |
57 | =head1 LICENSE |
58 | |
59 | See L<Reaction::Class> for the license. |
60 | |
61 | =cut |