NAME
PNI::Slot - is a basic unit of data
SYNOPSIS
my $slot = PNI::Slot->new;
$slot->data('foo');
ATTRIBUTES
data
my $data = $slot->data;
It can be a scalar or a reference.
node
my $node = $slot->node;
Abstract attribute used by PNI::In and PNI::Out to hold a reference to its PNI::Node.
METHODS
is_array
$slot->data([qw(foo bar)]);
$slot->is_array; # true
is_code
$slot->data(sub { say 'hello'; });
$slot->is_code; # true
is_defined
is_hash
$slot->data({ foo => 'bar' });
$slot->is_hash; # true
is_number
$slot->data(0);
$slot->is_number; # true
is_scalar
is_string
is_undef
to_hashref
my $slot_hashref = $slot->to_hashref;
Returns an hash ref representing the slot.
type
Returns a string representing the slot data type, i.e. UNDEF, SCALAR or the return value of ref
function applyed to the value of the data
attribute..