Skip to content

Please document that some_method => \&some_sub works #18

@bpj

Description

@bpj

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 },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions