Venus::Role::Valuable - Valuable Role
Valuable Role for Perl 5
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
default
get
set
This package has the following attributes:
value(Any)
This attribute is read-write, accepts (Any) values, and is optional.
(Any)
This package provides the following methods:
default() (Any)
The default method returns the default value, i.e. undef.
undef
Since 0.01
0.01
package main; my $example = Example->new; my $default = $example->default; # undef
get() (Any)
The get method gets and returns the value.
package main; my $example = Example->new(value => 'hey, there'); my $get = $example->get; # "hey, there"
set(Any $value) (Any)
The set method set the value and returns the value set.
package main; my $example = Example->new(value => 'hey, there'); my $set = $example->set('hi, there'); # "hi, there"
To install Venus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Venus
CPAN shell
perl -MCPAN -e shell install Venus
For more information on module installation, please visit the detailed CPAN module installation guide.