Venus::Role::Valuable

Valuable Role

Valuable Role for Perl 5

method: default method: get method: set

package Example;

use Venus::Class;

with 'Venus::Role::Valuable';

package main;

my $example = Example->new;

# $example->value;

This package modifies the consuming package and provides a value attribute which defaults to what's returned by the default method, as well as get and set methods for modifying the value.

value: rw, opt, Any

The default method returns the default value, i.e. undef.

default() (Any)

{ since => '0.01', }

=example-1 default

package main;

my $example = Example->new;

my $default = $example->default;

# undef

The get method gets and returns the value.

get() (Any)

{ since => '0.01', }

=example-1 get

package main;

my $example = Example->new(value => 'hey, there');

my $get = $example->get;

# "hey, there"

The set method set the value and returns the value set.

set(Any $value) (Any)

{ since => '0.01', }

=example-1 set

package main;

my $example = Example->new(value => 'hey, there');

my $set = $example->set('hi, there');

# "hi, there"

t/Venus.t: pdml: authors t/Venus.t: pdml: license

17 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 47:

Unknown directive: =synopsis

Around line 72:

Unknown directive: =description

Around line 82:

Unknown directive: =attributes

Around line 90:

Unknown directive: =method

Around line 94:

Unknown directive: =signature

Around line 98:

Unknown directive: =metadata

Around line 124:

Unknown directive: =method

Around line 128:

Unknown directive: =signature

Around line 132:

Unknown directive: =metadata

Around line 158:

Unknown directive: =method

Around line 162:

Unknown directive: =signature

Around line 166:

Unknown directive: =metadata

Around line 192:

Unknown directive: =partials