aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/Meta/InterfaceModel/Object/Class.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Reaction/Meta/InterfaceModel/Object/Class.pm')
-rw-r--r--lib/Reaction/Meta/InterfaceModel/Object/Class.pm55
1 files changed, 27 insertions, 28 deletions
diff --git a/lib/Reaction/Meta/InterfaceModel/Object/Class.pm b/lib/Reaction/Meta/InterfaceModel/Object/Class.pm
index 8fad3dc..912af6e 100644
--- a/lib/Reaction/Meta/InterfaceModel/Object/Class.pm
+++ b/lib/Reaction/Meta/InterfaceModel/Object/Class.pm
@@ -5,36 +5,35 @@ use aliased 'Reaction::Meta::InterfaceModel::Object::DomainModelAttribute';
use Reaction::Class;
-class Class is 'Reaction::Meta::Class', which {
-
- implements new => as { shift->SUPER::new(@_) };
-
- 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;
- };
+use namespace::clean -except => [ qw(meta) ];
+extends 'Reaction::Meta::Class';
+sub new { shift->SUPER::new(@_) };
+
+around initialize => sub {
+ my $super = shift;
+ my $class = shift;
+ my $pkg = shift;
+ $super->($class, $pkg, attribute_metaclass => ParameterAttribute, @_);
+};
+sub add_domain_model {
+ my $self = shift;
+ my $name = shift;
+ $self->add_attribute($name, metaclass => DomainModelAttribute, @_);
+};
+sub parameter_attributes {
+ my $self = shift;
+ return grep { $_->isa(ParameterAttribute) }
+ $self->compute_all_applicable_attributes;
};
+sub domain_models {
+ my $self = shift;
+ return grep { $_->isa(DomainModelAttribute) }
+ $self->compute_all_applicable_attributes;
+};
+
+__PACKAGE__->meta->make_immutable;
+
1;