Subject: | Possible documentation Bug in POD of Class::MOP::Attribute |
Hi.
In the POD for the initializer section:
===
The initializer is called as a method with three arguments. The first is
the value that was passed to the constructor. The second is a subroutine
reference that can be called to actually set the attribute's value, and
the last is the associated Class::MOP::Attribute object.
===
The code example below reads:
===
Class::MOP::Attribute->new(
'doubled' => (
initializer => sub {
my ( $instance, $value, $set ) = @_;
$set->( $value * 2 );
},
)
);
===
I suspect that the order mentioned in the first pasted section is
incorrect. It should be:
===
The initializer is called as a method with three arguments. The first is
the associated Class::MOP::Attribute object. The second is the value
that was passed to the constructor, and the last is a subroutine
reference that can be called to actually set the attribute's value.
===
Kind regards,
Florian