use Scalar::Util 'weaken', 'blessed';
-our $VERSION = '0.04';
+our $VERSION = '0.65';
our $AUTHORITY = 'cpan:STEVAN';
-sub meta {
- require Class::MOP::Class;
- Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
-}
+use base 'Class::MOP::Object';
sub new {
my ($class, $meta, @attrs) = @_;
# which is *probably* a safe
# assumption,.. but you can
# never tell <:)
- '$!meta' => $meta,
- '@!slots' => { map { $_ => undef } @slots },
+ 'meta' => $meta,
+ 'slots' => { map { $_ => undef } @slots },
} => $class;
- weaken($instance->{'$!meta'});
+ weaken($instance->{'meta'});
return $instance;
}
-sub associated_metaclass { (shift)->{'$!meta'} }
+sub associated_metaclass { (shift)->{'meta'} }
sub create_instance {
my $self = shift;
sub get_all_slots {
my $self = shift;
- return keys %{$self->{'@!slots'}};
+ return keys %{$self->{'slots'}};
}
sub is_valid_slot {
my ($self, $slot_name) = @_;
- exists $self->{'@!slots'}->{$slot_name};
+ exists $self->{'slots'}->{$slot_name};
}
# operations on created instances
sub initialize_slot {
my ($self, $instance, $slot_name) = @_;
- #$self->set_slot_value($instance, $slot_name, undef);
+ return;
}
sub deinitialize_slot {
sub inline_initialize_slot {
my ($self, $instance, $slot_name) = @_;
- $self->inline_set_slot_value($instance, $slot_name, 'undef'),
+ return '';
}
sub inline_deinitialize_slot {
The meta instance is used by attributes for low level storage.
Using this API generally violates attribute encapsulation and is not
-reccomended, instead look at L<Class::MOP::Attribute/get_value>,
-L<Class::MOP::Attribute/set_value> for the reccomended way to fiddle with
-attribute values in a generic way, independant of how/whether accessors have
+recommended, instead look at L<Class::MOP::Attribute/get_value>,
+L<Class::MOP::Attribute/set_value> for the recommended way to fiddle with
+attribute values in a generic way, independent of how/whether accessors have
been defined. Accessors can be found using L<Class::MOP::Class/get_attribute>.
This may seem like over-abstraction, but by abstracting
=back
-=head2 Instrospection
+=head2 Introspection
NOTE: There might be more methods added to this part of the API,
we will add then when we need them basically.