my %attrs
= map {
my $meta = Class::MOP::class_of($_);
- $meta && $meta->can('get_class_attribute_map')
- ? %{ $meta->get_class_attribute_map() }
+ $meta && $meta->can('_class_attribute_map')
+ ? %{ $meta->_class_attribute_map() }
: ()
}
reverse $self->linearized_isa;
return $self->name() . q'::__ClassAttributeValues';
}
-sub inline_class_slot_access {
+sub _inline_class_slot_access {
my $self = shift;
my $name = shift;
. quotemeta($name) . '"}';
}
-sub inline_get_class_slot_value {
+sub _inline_get_class_slot_value {
my $self = shift;
my $name = shift;
- return $self->inline_class_slot_access($name);
+ return $self->_inline_class_slot_access($name);
}
-sub inline_set_class_slot_value {
+sub _inline_set_class_slot_value {
my $self = shift;
my $name = shift;
my $val_name = shift;
- return $self->inline_class_slot_access($name) . ' = ' . $val_name;
+ return $self->_inline_class_slot_access($name) . ' = ' . $val_name;
}
-sub inline_is_class_slot_initialized {
+sub _inline_is_class_slot_initialized {
my $self = shift;
my $name = shift;
- return 'exists ' . $self->inline_class_slot_access($name);
+ return 'exists ' . $self->_inline_class_slot_access($name);
}
-sub inline_deinitialize_class_slot {
+sub _inline_deinitialize_class_slot {
my $self = shift;
my $name = shift;
- return 'delete ' . $self->inline_class_slot_access($name);
+ return 'delete ' . $self->_inline_class_slot_access($name);
}
-sub inline_weaken_class_slot_value {
+sub _inline_weaken_class_slot_value {
my $self = shift;
my $name = shift;
return
'Scalar::Util::weaken( '
- . $self->inline_class_slot_access($name) . ')';
+ . $self->_inline_class_slot_access($name) . ')';
}
1;
+# ABSTRACT: A trait for classes with class attributes
+
__END__
=pod
-=head1 NAME
-
-MooseX::ClassAttribute::Trait::Class - A metaclass role for classes with class attributes
-
=head1 SYNOPSIS
for my $attr ( HasClassAttributes->meta()->get_all_class_attributes() )
=head2 $meta->get_class_attribute_list()
-=head2 $meta->get_class_attribute_map()
-
These methods operate on the current metaclass only.
=head2 $meta->add_class_attribute(...)
solely because they are used by other meta roles and classes in this
distribution.
-=head2 $meta->inline_class_slot_access($name)
-
-=head2 $meta->inline_get_class_slot_value($name)
-
-=head2 $meta->inline_set_class_slot_value($name, $val_name)
-
-=head2 $meta->inline_is_class_slot_initialized($name)
-
-=head2 $meta->inline_deinitialize_class_slot($name)
-
-=head2 $meta->inline_weaken_class_slot_value($name)
-
-These methods return code snippets for inlining.
-
-There's really no good reason for you to call these methods unless
-you're doing some deep hacking. They are named as public methods
-solely because they are used by other meta roles and classes in this
-distribution.
-
-=head1 AUTHOR
-
-Dave Rolsky, C<< <autarch@urth.org> >>
-
=head1 BUGS
See L<MooseX::ClassAttribute> for details.
-=head1 COPYRIGHT & LICENSE
-
-Copyright 2007-2008 Dave Rolsky, All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
=cut