Nano::Track
Trackable Role
Trackable Entity Role
method: decr method: del method: get method: getpush method: getset method: getunshift method: incr method: merge method: pop method: poppush method: push method: set method: shift method: shiftunshift method: unshift
package Example;
use Moo;
extends 'Nano::Node';
with 'Nano::Track';
sub creator {
my ($self, @args) = @_;
return $self->getset('creator', @args);
}
sub touched {
my ($self, @args) = @_;
return $self->incr('touched');
}
package main;
my $example = Example->new;
# $example->touched;
Nano::Types
changed: ro, opt, Changes
This package provides a transactional change-tracking role, useful for creating a history of changes and/or preventing race conditions when saving data for Nano::Node entities. Note: Due to conflicting method names, this role cannot be used with the Nano::Stash role.
The decr method decrements the data associated with a specific key.
decr(Str $name) : Int
=example-1 decr
my $example = Example->new;
my $upvote = $example->decr('upvote');
The del method deletes the data associated with a specific key.
del(Str $name) : Any
=example-1 del
my $example = Example->new;
my $touched = $example->del('touched');
The get method return the data associated with a specific key.
get($name) : Any
=example-1 get
my $example = Example->new;
my $profile = $example->get('profile');
The getset method calls "get" or "set" based on the arguments provided. Allows you to easily create method-based accessors.
getset(Str $name, Any @args) : Any
=example-1 getset
my $example = Example->new;
my $profile = $example->getset('profile', {
nickname => 'demonstration',
});
=example-2 getset
my $example = Example->new;
$example->getset('profile', {
nickname => 'demonstration',
});
my $profile = $example->getset('profile');
The incr method increments the data associated with a specific key.
incr(Str $name) : Int
=example-1 incr
my $example = Example->new;
my $upvote = $example->incr('upvote');
The merge method commits the data associated with a specific key to the channel as a partial to be merged into any existing data.
merge(Str $name, HashRef $value) : HashRef
=example-1 merge
my $example = Example->new;
my $merge = $example->merge('profile', {
password => 's3crets',
});
=example-2 merge
my $example = Example->new;
$example->set('profile', {
nickname => 'demonstration',
});
my $merge = $example->merge('profile', {
password => 's3crets',
});
The pop method pops the data off of the stack associated with a specific key.
pop(Str $name) : Any
=example-1 pop
my $example = Example->new;
my $steps = $example->pop('steps');
The push method pushes data onto the stack associated with a specific key.
push(Str $name, Any @value) : ArrayRef[Any]
=example-1 push
my $example = Example->new;
my $arguments = $example->push('steps', '#1');
The getpush method calls "push" or "get" based on the arguments provided. Allows you to easily create method-based accessors.
getpush(Str $name, Any @args) : ArrayRef[Any] | Any
=example-1 getpush
my $example = Example->new;
my $steps = $example->getpush('steps');
The poppush method calls "push" or "pop" based on the arguments provided. Allows you to easily create method-based accessors.
poppush(Str $name, Any @args) : ArrayRef[Any] | Any
=example-1 poppush
my $example = Example->new;
my $steps = $example->poppush('steps');
The set method commits the data associated with a specific key to the channel.
set(Str $name, Any @args) : Any
=example-1 set
my $example = Example->new;
my $email = $example->set('email', 'try@example.com');
The shift method shifts data off of the stack associated with a specific key.
shift(Str $name) : Any
=example-1 shift
my $example = Example->new;
my $steps = $example->shift('steps');
The unshift method unshifts data onto the stack associated with a specific key.
unshift(Str $name, Any @value) : ArrayRef[Any] | Any
=example-1 unshift
my $example = Example->new;
my $arguments = $example->unshift('steps');
The shiftunshift method calls "unshift" or "shift" based on the arguments provided. Allows you to easily create method-based accessors.
shiftunshift(Str $name, Any @args) : ArrayRef[Any] | Any
=example-1 shiftunshift
my $example = Example->new;
my $step = $example->shiftunshift('steps');
The getunshift method calls "unshift" or "get" based on the arguments provided. Allows you to easily create method-based accessors.
getunshift(Str $name, Any @args) : ArrayRef[Any] | Any
=example-1 getunshift
my $example = Example->new;
my $step = $example->getunshift('steps');
52 POD Errors
The following errors were encountered while parsing the POD:
- Around line 10:
Unknown directive: =name
- Around line 16:
Unknown directive: =tagline
- Around line 22:
Unknown directive: =abstract
- Around line 28:
Unknown directive: =includes
- Around line 48:
Unknown directive: =synopsis
- Around line 76:
Unknown directive: =libraries
- Around line 82:
Unknown directive: =attributes
- Around line 88:
Unknown directive: =description
- Around line 97:
Unknown directive: =method
- Around line 101:
Unknown directive: =signature
- Around line 123:
=cut found outside a pod block. Skipping to next block.
- Around line 125:
Unknown directive: =method
- Around line 129:
Unknown directive: =signature
- Around line 149:
=cut found outside a pod block. Skipping to next block.
- Around line 151:
Unknown directive: =method
- Around line 155:
Unknown directive: =signature
- Around line 177:
=cut found outside a pod block. Skipping to next block.
- Around line 179:
Unknown directive: =method
- Around line 184:
Unknown directive: =signature
- Around line 208:
Unknown directive: =method
- Around line 212:
Unknown directive: =signature
- Around line 233:
=cut found outside a pod block. Skipping to next block.
- Around line 235:
Unknown directive: =method
- Around line 240:
Unknown directive: =signature
- Around line 266:
Unknown directive: =method
- Around line 270:
Unknown directive: =signature
- Around line 290:
=cut found outside a pod block. Skipping to next block.
- Around line 292:
Unknown directive: =method
- Around line 296:
Unknown directive: =signature
- Around line 314:
=cut found outside a pod block. Skipping to next block.
- Around line 316:
Unknown directive: =method
- Around line 321:
Unknown directive: =signature
- Around line 339:
=cut found outside a pod block. Skipping to next block.
- Around line 341:
Unknown directive: =method
- Around line 346:
Unknown directive: =signature
- Around line 366:
=cut found outside a pod block. Skipping to next block.
- Around line 376:
=cut found outside a pod block. Skipping to next block.
- Around line 378:
Unknown directive: =method
- Around line 382:
Unknown directive: =signature
- Around line 400:
=cut found outside a pod block. Skipping to next block.
- Around line 402:
Unknown directive: =method
- Around line 406:
Unknown directive: =signature
- Around line 426:
=cut found outside a pod block. Skipping to next block.
- Around line 428:
Unknown directive: =method
- Around line 432:
Unknown directive: =signature
- Around line 450:
=cut found outside a pod block. Skipping to next block.
- Around line 452:
Unknown directive: =method
- Around line 457:
Unknown directive: =signature
- Around line 475:
=cut found outside a pod block. Skipping to next block.
- Around line 477:
Unknown directive: =method
- Around line 482:
Unknown directive: =signature
- Around line 502:
=cut found outside a pod block. Skipping to next block.