my $meta = User->meta();
- for my $attribute ( $meta->compute_all_applicable_attributes ) {
+ for my $attribute ( $meta->get_all_attributes ) {
print $attribute->name(), "\n";
if ( $attribute->has_type_constraint ) {
}
}
- for my $method ( $meta->compute_all_applicable_methods ) {
+ for my $method ( $meta->get_all_methods ) {
print $method->name, "\n";
}
my ( @init, @non_init );
- foreach my $attr ( grep { $_->has_value($self) } $self->meta->compute_all_applicable_attributes ) {
+ foreach my $attr ( grep { $_->has_value($self) } $self->meta->get_all_attributes ) {
push @{ $attr->has_init_arg ? \@init : \@non_init }, $attr;
}
my $params = @_ == 1 ? $_[0] : {@_};
my $self = $class->SUPER::new_object($params);
- foreach my $attr ( $class->compute_all_applicable_attributes() ) {
+ foreach my $attr ( $class->get_all_attributes() ) {
next unless $attr->can('has_trigger') && $attr->has_trigger;
return $self;
}
-sub construct_instance {
+sub _construct_instance {
my $class = shift;
my $params = @_ == 1 ? $_[0] : {@_};
my $meta_instance = $class->get_meta_instance;
# but this is foreign inheritance, so we might
# have to kludge it in the end.
my $instance = $params->{'__INSTANCE__'} || $meta_instance->create_instance();
- foreach my $attr ($class->compute_all_applicable_attributes()) {
+ foreach my $attr ($class->get_all_attributes()) {
$attr->initialize_instance_slot($meta_instance, $instance, $params);
}
return $instance;
# specific to this subclass
'options' => $options{options},
'meta_instance' => $meta->get_meta_instance,
- 'attributes' => [ $meta->compute_all_applicable_attributes ],
+ 'attributes' => [ $meta->get_all_attributes ],
# ...
'associated_metaclass' => $meta,
} => $class;
return +{
map { $_->name => $_->get_value($instance) }
grep { $_->has_value($instance) }
- $class->compute_all_applicable_attributes
+ $class->get_all_attributes
};
}
map { $_->init_arg => $_->get_value($instance) }
grep { $_->has_value($instance) }
grep { defined($_->init_arg) }
- $class->compute_all_applicable_attributes
+ $class->get_all_attributes
};
}
extends 'Moose::Meta::Class';
- override 'construct_instance' => sub {
+ override '_construct_instance' => sub {
my $class = shift;
my $params = @_ == 1 ? $_[0] : {@_};
return $class->get_meta_instance->find_instance($params->{oid})