changes for 0.002000, thank you xinming for reminding me, I'm a fucking idiot
[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 use namespace::clean -except => [ qw(meta) ];
9 extends 'Reaction::Meta::Class';
10
11 around initialize => sub {
12   my $super = shift;
13   my $class = shift;
14   my $pkg   = shift;
15   $super->($class, $pkg, attribute_metaclass => ParameterAttribute, @_);
16 };
17 sub add_domain_model {
18   my $self = shift;
19   my $name = shift;
20   $self->add_attribute($name, metaclass => DomainModelAttribute, @_);
21 };
22 sub parameter_attributes {
23   my $self = shift;
24   return grep { $_->isa(ParameterAttribute) } 
25     $self->get_all_attributes;
26 };
27 sub domain_models {
28   my $self = shift;
29   return grep { $_->isa(DomainModelAttribute) } 
30     $self->get_all_attributes;
31 };
32
33 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
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