Venus::Role::Serializable

Serializable Role

Serializable Role for Perl 5

method: serialize

package Example;

use Venus::Class;

with 'Venus::Role::Serializable';

attr 'test';

package main;

my $example = Example->new(test => 123);

# $example->serialize;

# {test => 123}

This package provides a mechanism for serializing objects or the return value of a dispatched method call.

The serialize method serializes the invocant or the return value of a dispatched method call, and returns the result.

serialize(string | coderef $code, any @args) (any)

{ since => '1.75', }

=example-1 serialize

package Example1;

use Venus::Class 'with';

with 'Venus::Role::Serializable';

sub ARGS {
  (@_[1..$#_])
}

sub DATA {
  [@_[1..$#_]]
}

package main;

my $example1 = Example1->new(1..4);

# bless([1..4], 'Example1')

# my $result = $example1->serialize;

# [1..4]

t/Venus.t: present: authors t/Venus.t: present: license

19 POD Errors

The following errors were encountered while parsing the POD:

Around line 16:

Unknown directive: =name

Around line 24:

Unknown directive: =tagline

Around line 32:

Unknown directive: =abstract

Around line 40:

Unknown directive: =includes

Around line 48:

Unknown directive: =synopsis

Around line 81:

Unknown directive: =description

Around line 90:

Unknown directive: =method

Around line 95:

Unknown directive: =signature

Around line 99:

Unknown directive: =metadata

Around line 169:

=cut found outside a pod block. Skipping to next block.

Around line 209:

=cut found outside a pod block. Skipping to next block.

Around line 247:

=cut found outside a pod block. Skipping to next block.

Around line 285:

=cut found outside a pod block. Skipping to next block.

Around line 315:

=cut found outside a pod block. Skipping to next block.

Around line 345:

=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 408:

=cut found outside a pod block. Skipping to next block.

Around line 445:

=cut found outside a pod block. Skipping to next block.

Around line 460:

Unknown directive: =partials