Venus::Kind

Kind Base Class

Kind Base Class for Perl 5

method: checksum method: numified method: renew method: safe method: self method: stringified method: trap

package Example;

use Venus::Class;

base 'Venus::Kind';

package main;

my $example = Example->new;

# bless({}, "Example")

This package provides identity and methods common across all Venus classes.

Venus::Role::Boxable Venus::Role::Catchable Venus::Role::Comparable Venus::Role::Deferrable Venus::Role::Digestable Venus::Role::Doable Venus::Role::Dumpable Venus::Role::Matchable Venus::Role::Mockable Venus::Role::Patchable Venus::Role::Printable Venus::Role::Reflectable Venus::Role::Serializable Venus::Role::Testable Venus::Role::Throwable Venus::Role::Tryable

The checksum method returns an md5 hash string representing the stringified object value (or the object itself).

checksum() (string)

{ since => '0.08', }

=example-1 checksum

# given: synopsis;

my $checksum = $example->checksum;

# "859a86eed4b2d97eb7b830b02f06de32"

The numified method returns the numerical representation of the object which is typically the length (or character count) of the stringified object.

numified() (number)

{ since => '0.08', }

=example-1 numified

# given: synopsis;

my $numified = $example->numified;

# 22

The renew method returns a new instance of the invocant by instantiating the underlying class passing all recognized class attributes to the constructor. Note: This method is not analogous to clone, i.e. attributes which are references will be passed to the new object as references.

renew(any @args) (object)

{ since => '1.23', }

=example-1 renew

# given: synopsis

package main;

my $renew = $example->renew;

# bless({}, "Example")

The safe method dispatches the method call or executes the callback and returns the result, supressing warnings and exceptions. If an exception is thrown this method will return undef. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

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

{ since => '0.08', }

=example-1 safe

# given: synopsis;

my $safe = $example->safe('class');

# "Example"

The self method returns the invocant.

self() (any)

{ since => '1.23', }

=example-1 self

# given: synopsis

package main;

my $self = $example->self;

# bless({}, "Example")

The stringified method returns the object, stringified (i.e. a dump of the object's value).

stringified() (string)

{ since => '0.08', }

=example-1 stringified

# given: synopsis;

my $stringified = $example->stringified;

# bless({}, 'Example')

The trap method dispatches the method call or executes the callback and returns a tuple (i.e. a 3-element arrayref) with the results, warnings, and exceptions from the code execution. If an exception is thrown, the results (i.e. the 1st-element) will be an empty arrayref. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.

trap(string | coderef $code, any @args) (tuple[arrayref, arrayref, arrayref])

{ since => '0.08', }

=example-1 trap

# given: synopsis;

my $result = $example->trap('class');

# ["Example"]

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

41 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 54:

Unknown directive: =synopsis

Around line 78:

Unknown directive: =description

Around line 86:

Unknown directive: =integrates

Around line 109:

Unknown directive: =method

Around line 114:

Unknown directive: =signature

Around line 118:

Unknown directive: =metadata

Around line 160:

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

Around line 170:

Unknown directive: =method

Around line 175:

Unknown directive: =signature

Around line 179:

Unknown directive: =metadata

Around line 221:

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

Around line 231:

Unknown directive: =method

Around line 238:

Unknown directive: =signature

Around line 242:

Unknown directive: =metadata

Around line 289:

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

Around line 323:

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

Around line 346:

Unknown directive: =method

Around line 353:

Unknown directive: =signature

Around line 357:

Unknown directive: =metadata

Around line 391:

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

Around line 412:

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

Around line 422:

Unknown directive: =method

Around line 426:

Unknown directive: =signature

Around line 430:

Unknown directive: =metadata

Around line 459:

Unknown directive: =method

Around line 464:

Unknown directive: =signature

Around line 468:

Unknown directive: =metadata

Around line 511:

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

Around line 521:

Unknown directive: =method

Around line 530:

Unknown directive: =signature

Around line 534:

Unknown directive: =metadata

Around line 566:

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

Around line 586:

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

Around line 606:

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

Around line 629:

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

Around line 649:

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

Around line 662:

Unknown directive: =partials