1 package MooseX::ClassAttribute::Meta::Method::Accessor;
7 our $AUTHORITY = 'cpan:DROLSKY';
11 extends 'Moose::Meta::Method::Accessor';
19 my $attr = $self->associated_attribute();
21 my $mi = $attr->associated_class()->get_meta_instance();
22 my $slot_name = $attr->slots();
24 my $package_var = sprintf q{$%s::__ClassAttribute{'%s'}}, $attr->associated_class()->name(), $slot_name;
26 my $code = "$package_var = $value;";
27 $code .= "Scalar::Util::weaken $package_var;"
28 if $attr->is_weak_ref();
37 my $attr = $self->associated_attribute();
39 my $mi = $attr->associated_class()->get_meta_instance();
40 my $slot_name = $attr->slots();
42 return sprintf q{$%s::__ClassAttribute{'%s'}}, $attr->associated_class()->name(), $slot_name;
45 sub generate_accessor_method {
46 shift->generate_accessor_method_inline(@_);
49 sub generate_reader_method {
50 shift->generate_reader_method_inline(@_);
53 sub generate_writer_method {
54 shift->generate_writer_method_inline(@_);