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 15:

Unknown directive: =name

Around line 23:

Unknown directive: =tagline

Around line 31:

Unknown directive: =abstract

Around line 39:

Unknown directive: =includes

Around line 47:

Unknown directive: =synopsis

Around line 80:

Unknown directive: =description

Around line 89:

Unknown directive: =method

Around line 94:

Unknown directive: =signature

Around line 98:

Unknown directive: =metadata

Around line 168:

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

Around line 208:

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

Around line 246:

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

Around line 284:

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

Around line 314:

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

Around line 344:

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

Around line 375:

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

Around line 407:

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

Around line 444:

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

Around line 459:

Unknown directive: =partials