aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/Meta/InterfaceModel/Object/Class.pm
blob: da99ffe9ce3de8d20a3f240b45002d579493894e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package Reaction::Meta::InterfaceModel::Object::Class;

use aliased 'Reaction::Meta::InterfaceModel::Object::ParameterAttribute';
use aliased 'Reaction::Meta::InterfaceModel::Object::DomainModelAttribute';

use Reaction::Class;

class Class is 'Reaction::Meta::Class', which {

  around initialize => sub {
    my $super = shift;
    my $class = shift;
    my $pkg   = shift;
    $super->($class, $pkg, attribute_metaclass => ParameterAttribute, @_);
  };

  implements add_domain_model => as{
    my $self = shift;
    my $name = shift;
    $self->add_attribute($name, metaclass => DomainModelAttribute, @_);
  };

  implements parameter_attributes => as {
    my $self = shift;
    return grep { $_->isa(ParameterAttribute) } 
      $self->compute_all_applicable_attributes;
  };

  implements domain_models => as {
    my $self = shift;
    return grep { $_->isa(DomainModelAttribute) } 
      $self->compute_all_applicable_attributes;
  };

};
  
1;

=head1 NAME

Reaction::Meta::InterfaceModel::Object::Class

=head1 DESCRIPTION

=head1 METHODS

=head2 add_domain_model

=head2 domain_models

=head2 parameter_attributes

=head1 AUTHORS

See L<Reaction::Class> for authors.

=head1 LICENSE

See L<Reaction::Class> for the license.

=cut