1 package MooseX::ClassAttribute;
7 our $AUTHORITY = 'cpan:DROLSKY';
10 use MooseX::ClassAttribute::Meta::Method::Accessor;
12 extends 'Moose::Meta::Attribute';
15 sub accessor_metaclass { 'MooseX::ClassAttribute::Meta::Method::Accessor' }
17 # This is called when an object is constructed.
18 sub initialize_instance_slot
20 my ( $self, $meta_instance, $instance, $params ) = @_;
22 return unless $self->has_init_arg();
24 my $init_arg = $self->init_arg();
26 confess "Cannot set a class attribute via the constructor ($init_arg)"
27 if exists $params->{$init_arg};
33 # This is the bit of magic that lets you specify the metaclass as
34 # 'ClassAttribute' rather than the full name when creating an
36 package Moose::Meta::Attribute::Custom::ClassAttribute;
38 sub register_implementation { 'MooseX::ClassAttribute' }
49 MooseX::ClassAttribute - The fantastic new MooseX::ClassAttribute!
53 Quick summary of what the module does.
55 Perhaps a little code snippet.
57 use MooseX::ClassAttribute;
59 my $foo = MooseX::ClassAttribute->new();
65 This class provides the following methods
69 Dave Rolsky, C<< <autarch@urth.org> >>
73 Please report any bugs or feature requests to C<bug-moosex-classattribute@rt.cpan.org>,
74 or through the web interface at L<http://rt.cpan.org>. I will be
75 notified, and then you'll automatically be notified of progress on
76 your bug as I make changes.
78 =head1 COPYRIGHT & LICENSE
80 Copyright 2007 Dave Rolsky, All Rights Reserved.
82 This program is free software; you can redistribute it and/or modify
83 it under the same terms as Perl itself.