{
has
ten
=>
is
=>
'ro'
,
default
=>
sub
{
return
'ten'
};
}
role Before {
public eight {
return
'8'
}
};
role World
with
Test::Role allow
qw/Hello/
with
qw/Before/
{
private four {
return
'fourth'
}
};
class Hello
with
World allow
qw/main/
{
attributes
one
=> [{
okay
=>
'one'
}],
[
qw/six seven/
] => [rw, Str, {
default
=>
'ruling the world'
}];
validate_subs
two
=> {
params
=> {
message
=> [Str,
sub
{
'Hello World'
}]
}
};
public two {
return
$_
[0]->{message} }
public three {
return
'lost'
; }
private five {
return
$self
->four }
};
class Night is
qw/Hello/
{
public nine {
return
'crazy'
}
};
my
$hello
= Hello->new();
is(
$hello
->five,
'fourth'
);
done_testing();