-package LazyClass;
+package # hide the package from PAUSE
+ LazyClass;
use strict;
use warnings;
-use Class::MOP 'meta';
-
-our $VERSION = '0.01';
+our $VERSION = '0.02';
use base 'Class::MOP::Class';
sub construct_instance {
my ($class, %params) = @_;
my $instance = {};
- foreach my $attr (map { $_->{attribute} } $class->compute_all_applicable_attributes()) {
+ foreach my $attr ($class->compute_all_applicable_attributes()) {
# if the attr has an init_arg, use that, otherwise,
# use the attributes name itself as the init_arg
my $init_arg = $attr->has_init_arg() ? $attr->init_arg() : $attr->name;
return $instance;
}
-package LazyClass::Attribute;
+package # hide the package from PAUSE
+ LazyClass::Attribute;
use strict;
use warnings;
-use Class::MOP 'meta';
-
-our $VERSION = '0.01';
+our $VERSION = '0.02';
use base 'Class::MOP::Attribute';
package BinaryTree;
- sub meta {
- LazyClass->initialize($_[0] => (
- ':attribute_metaclass' => 'LazyClass::Attribute'
- ));
- }
+ use metaclass 'LazyClass' => (
+ ':attribute_metaclass' => 'LazyClass::Attribute'
+ );
BinaryTree->meta->add_attribute('$:node' => (
accessor => 'node',