Venus::Role::Dumpable

Dumpable Role

Dumpable Role for Perl 5

method: dump method: dump_pretty

package Example;

use Venus::Class;

attr 'test';

with 'Venus::Role::Dumpable';

package main;

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

# $example->dump;

This package modifies the consuming package and provides methods for dumping the object or the return value of a dispatched method call.

The dump method returns a string representation of the underlying data. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

dump(string | coderef $method, any @args) (string)

{ since => '0.01', }

=example-1 dump

package main;

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

my $dump = $example->dump;

# "bless( {test => 123}, 'Example' )"

The dump_pretty method returns a string representation of the underlying data that is human-readable and useful for debugging. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

dump_pretty(string | coderef $method, any @args) (string)

{ since => '0.01', }

=example-1 dump_pretty

package main;

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

my $dump_pretty = $example->dump_pretty;

# bless( {
#          test => 123
#        }, 'Example' )

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

13 POD Errors

The following errors were encountered while parsing the POD:

Around line 13:

Unknown directive: =name

Around line 21:

Unknown directive: =tagline

Around line 29:

Unknown directive: =abstract

Around line 37:

Unknown directive: =includes

Around line 46:

Unknown directive: =synopsis

Around line 73:

Unknown directive: =description

Around line 82:

Unknown directive: =method

Around line 88:

Unknown directive: =signature

Around line 92:

Unknown directive: =metadata

Around line 118:

Unknown directive: =method

Around line 125:

Unknown directive: =signature

Around line 129:

Unknown directive: =metadata

Around line 157:

Unknown directive: =partials