NAME
Object::Simple::Accessor - Provide a ability to create a accessor
SYNOPSYS
package YourModule;
use Object::Simple::Accessor qw/attr class_attr dual_attr/;
__PACKAGE__->attr(title => 'Good day');
__PACKAGE__->attr(authors => sub {[]});
Functions
You can export 'attr', 'class_attr', 'dual_attr'.
use Object::Simple::Accessor qw/attr class_attr dual_attr/;
See Object::Simple::Base to know the usage of these methods.
Purpose
Object::Simple::Base provide a constructor and ability to create accessors to this subclass.
package YourClass;
use base 'Object::Simple::Base';
But construcor and a ability to create accessors is linked. Object::Simple::Accessor provide only a ability to create accessors.
If you inherit other class, you provide a avility to create accessor to the class.
package YourClass;
use base 'LWP::UserAgent';
use Object::Simple::Accessor 'attr';
__PACKAGE__->attr('foo');
Author
Yuki Kimoto, <kimoto.yuki at gmail.com>
Github http://github.com/yuki-kimoto/
I develope this module at http://github.com/yuki-kimoto/Object-Simple
Please tell me bug if you find.
Copyright & license
Copyright 2008 Yuki Kimoto, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.