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: present: authors t/Venus.t: present: license
17 POD Errors
The following errors were encountered while parsing the POD:
- Around line 14:
Unknown directive: =name
- Around line 22:
Unknown directive: =tagline
- Around line 30:
Unknown directive: =abstract
- Around line 38:
Unknown directive: =includes
- Around line 48:
Unknown directive: =synopsis
- Around line 73:
Unknown directive: =description
- Around line 83:
Unknown directive: =attributes
- Around line 91:
Unknown directive: =method
- Around line 95:
Unknown directive: =signature
- Around line 99:
Unknown directive: =metadata
- Around line 125:
Unknown directive: =method
- Around line 129:
Unknown directive: =signature
- Around line 133:
Unknown directive: =metadata
- Around line 159:
Unknown directive: =method
- Around line 163:
Unknown directive: =signature
- Around line 167:
Unknown directive: =metadata
- Around line 193:
Unknown directive: =partials