do not include .git directory
[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
81393881 8use namespace::clean -except => [ qw(meta) ];
9extends 'Reaction::Meta::Class';
7adfd53f 10
81393881 11around initialize => sub {
12 my $super = shift;
13 my $class = shift;
14 my $pkg = shift;
15 $super->($class, $pkg, attribute_metaclass => ParameterAttribute, @_);
16};
17sub add_domain_model {
18 my $self = shift;
19 my $name = shift;
20 $self->add_attribute($name, metaclass => DomainModelAttribute, @_);
21};
22sub parameter_attributes {
23 my $self = shift;
24 return grep { $_->isa(ParameterAttribute) }
4d0bacd2 25 $self->get_all_attributes;
7adfd53f 26};
81393881 27sub domain_models {
28 my $self = shift;
29 return grep { $_->isa(DomainModelAttribute) }
4d0bacd2 30 $self->get_all_attributes;
81393881 31};
32
83529ec1 33__PACKAGE__->meta->make_immutable(inline_constructor => 0);
81393881 34
7adfd53f 35
361;
37
38=head1 NAME
39
40Reaction::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
54See L<Reaction::Class> for authors.
55
56=head1 LICENSE
57
58See L<Reaction::Class> for the license.
59
60=cut