Please document that it is possible to assign a reference to a named subroutine to a key to mock a method:
my $obj = qobj(
some_method => \&some_sub,
);
I had to dig up the implementation of AUTOLOAD to verify that this was indeed the case.
Use case: trying out a component when another component/embedded object isn't written yet, except for that one subroutine.
And even more importantly perhaps, document that in order to have a method return a coderef you have to say:
method_returning_coderef => qmeth { \&some_sub },
Please document that it is possible to assign a reference to a named subroutine to a key to mock a method:
I had to dig up the implementation of AUTOLOAD to verify that this was indeed the case.
Use case: trying out a component when another component/embedded object isn't written yet, except for that one subroutine.
And even more importantly perhaps, document that in order to have a method return a coderef you have to say: