Object::Pad::MOP::Slot - meta-object representation of data slot of a Object::Pad class
Object::Pad::MOP::Slot
Object::Pad
Instances of this class represent a data slot of a class implemented by Object::Pad. Accessors provide information about the slot. The special value method allows access to the value of the given slot on instances of its class, letting the meta-object be used as a proxy to it.
value
This API should be considered experimental even within the overall context in which Object::Pad is expermental.
$name = $metaslot->name
Returns the name of the slot, as a plain string including the leading sigil character.
$metaclass = $metaslot->class
Returns the Object::Pad::MOP::Class instance representing the class of which this slot is a member.
$current = $metaslot->value( $instance ) @current = $metaslot->value( $instance ) %current = $metaslot->value( $instance )
An accessor method which returns the current value of the slot from an object instance.
$metaslot->value( $instance ) = $new
On scalar slots, this method can also act as an lvalue mutator allowing a new value to be set.
$name = $metaslot->param_name
Since version 0.43.
Returns the name of the parameter if the slot has one; otherwise undef.
$has_param = $metaslot->has_param
Since version 0.42.
Returns true if the slot is assigned to be a named constructor parameter.
Paul Evans <leonerd@leonerd.org.uk>
To install Object::Pad, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Object::Pad
CPAN shell
perl -MCPAN -e shell install Object::Pad
For more information on module installation, please visit the detailed CPAN module installation guide.