-
-
25 Sep 2021 18:50:13 UTC
- Distribution: Mock-Data
- Module version: 0.03
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (195 / 7 / 0)
- Kwalitee
Bus factor: 1- 75.40% Coverage
- License: perl_5
- Perl: v5.10.0
- Activity
24 month- Tools
- Download (55.79KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Mock::Data::GeneratorSub - Wrap a coderef to become a blessed Generator object
DESCRIPTION
This class wraps a generator coderef to become a Generator object, and supply default parameters for "generate" which can be overridden or combined with additional parameters.
CONSTRUCTOR
new
Mock::Data::GeneratorSub->new( $coderef, @default_params );
This object's
generate
method calls the$coderef
after merging the parameters passed togenerate
with this list of@default_params
. When merging parameters, named parameters are replaced by-name, and positional parameters are replacing entirely if new positional parameters are provided.METHODS
generate
$generator->generate($mock, @params);
Merge
@params
with$self->params
and then call$self->coderef
compile
$generator->compile(@params);
Return a function
sub($mock){ ... }
which calls$self->coderef
with the@params
merged with$self->params
.AUTHOR
Michael Conrad <mike@nrdvana.net>
VERSION
version 0.03
COPYRIGHT AND LICENSE
This software is copyright (c) 2021 by Michael Conrad.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Mock::Data, copy and paste the appropriate command in to your terminal.
cpanm Mock::Data
perl -MCPAN -e shell install Mock::Data
For more information on module installation, please visit the detailed CPAN module installation guide.