NAME

Nano::Node - Persistable Entity

ABSTRACT

Persistable Entity Super Class

SYNOPSIS

use Nano::Node;

my $node = Nano::Node->new(
  id => '0000001',
);

# $node->save;

DESCRIPTION

This package provides a persistable entity super class. It is meant to be subclassed but can be used directly as well.

LIBRARIES

This package uses type constraints from:

Nano::Types

ATTRIBUTES

This package has the following attributes:

id

id(Str)

This attribute is read-only, accepts (Str) values, and is optional.

nano

nano(Nano)

This attribute is read-only, accepts (Nano) values, and is optional.

METHODS

This package implements the following methods:

drop

drop() : Object

The drop method removes the prior persisted object data.

drop example #1
# given: synopsis

$node = $node->drop;

load

load() : Object

The load method reloads and returns an object from source.

load example #1
# given: synopsis

$node->save;

$node = $node->load;

save

save() : Str

The save method commits the object data to the storage backend.

save example #1
# given: synopsis

my $term = $node->save;

serialize

serialize() : HashRef

The serialize method returns a persistence representaton of the invocant. Circular dependencies can result in a deep recursion error, however, circular dependencies can be persisted if modeled properly. Note: blessed objects which are neither Nano::Node nor Nano::Nodes will be ignored.

serialize example #1
# given: synopsis

my $serial = $node->serialize;

AUTHOR

Al Newkirk, awncorp@cpan.org

LICENSE

Copyright (C) 2011-2019, Al Newkirk, et al.

This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".

PROJECT

Wiki

Project

Initiatives

Milestones

Contributing

Issues