Venus::Role::Accessible
Accessible Role
Accessible Role for Perl 5
method: access method: assign
package Example;
use Venus::Class;
with 'Venus::Role::Accessible';
attr 'value';
sub downcase {
lc $_[0]->value
}
sub upcase {
uc $_[0]->value
}
package main;
my $example = Example->new(value => 'hello, there');
# $example->value;
This package modifies the consuming package and provides the access method for getting and setting attributes.
The access method gets or sets the class attribute specified.
access(Str $name, Any $value) (Any)
{ since => '1.23', }
=example-1 access
# given: synopsis
package main;
my $access = $example->access;
# undef
The assign method dispatches the method call or executes the callback, sets the class attribute specified to the result, and returns the result.
assign(Str $name, Str | CodeRef $code, Any @args) (Any)
{ since => '1.23', }
=example-1 assign
# given: synopsis
package main;
my $assign = $example->assign('value', 'downcase');
# "hello, there"
t/Venus.t: pdml: authors t/Venus.t: pdml: license
18 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 82:
Unknown directive: =description
- Around line 91:
Unknown directive: =method
- Around line 95:
Unknown directive: =signature
- Around line 99:
Unknown directive: =metadata
- Around line 134:
=cut found outside a pod block. Skipping to next block.
- Around line 154:
=cut found outside a pod block. Skipping to next block.
- Around line 182:
=cut found outside a pod block. Skipping to next block.
- Around line 196:
Unknown directive: =method
- Around line 201:
Unknown directive: =signature
- Around line 205:
Unknown directive: =metadata
- Around line 241:
=cut found outside a pod block. Skipping to next block.
- Around line 269:
=cut found outside a pod block. Skipping to next block.
- Around line 282:
Unknown directive: =partials