2 package Class::MOP::Instance;
8 use Scalar::Util 'blessed', 'reftype', 'weaken';
10 our $VERSION = '0.01';
13 require Class::MOP::Class;
14 Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
21 instance => (bless {} => $meta->name)
26 my ($self, $slot_name, $value) = @_;
27 return $self->{instance}->{$slot_name} = $value;
31 my ($self, $slot_name) = @_;
32 exists $self->{instance}->{$slot_name} ? 1 : 0;
36 my ($self, $instance, $slot_name) = @_;
37 return $instance->{$slot_name};
41 my ($self, $instance, $slot_name, $value) = @_;
42 $instance->{$slot_name} = $value;
46 my ($self, $instance, $slot_name) = @_;
47 defined $instance->{$slot_name} ? 1 : 0;
50 sub get_instance { (shift)->{instance} }
60 Class::MOP::Instance - Instance Meta Object
76 =item B<get_slot_value>
78 =item B<set_slot_value>
80 =item B<has_slot_value>
92 This will return a B<Class::MOP::Class> instance which is related
99 Stevan Little E<lt>stevan@iinteractive.comE<gt>
101 =head1 COPYRIGHT AND LICENSE
103 Copyright 2006 by Infinity Interactive, Inc.
105 L<http://www.iinteractive.com>
107 This library is free software; you can redistribute it and/or modify
108 it under the same terms as Perl itself.