Catalyst::ComponentRole::InjectionHelpers; - Common role for adaptors
package MyApp::MySpecialAdaptor use Moose; with 'Catalyst::ComponentRole::InjectionHelpers'; sub ACCEPT_CONTEXT { ... }
Common functionality and interface inforcement for injection helper adaptors. You should see Catalyst::Plugin::InjectionHelpers for more.
This role defines the following attributes
Your Catalyst application
A class name or coderef that is being adapted to run under Catalyst
The name of the method in your 'from' class that is used to create a new instance OR a coderef that is used to return an instance. Defaults to 'new'.
A list of Moose::Roles to be composed into your class
A coderef that you can use to transform configuration arguments into something more suitable for your class. For example, the configuration args is typically a hash, but your object class may require some positional arguments.
MyApp->inject_components( 'Model::Foo' => { from_class = 'Foo', transform_args => sub { my ($adaptor_instance, $coderef, $app, %args) = @_; my $path = delete $args{path}, return ($path, %args); }, }, );
Should return the args as they as used by the initialization method of the 'from_class'.
TBD
This role exposes the following public methods
Responsible for merging global configuration and anything passed in at call time
Perform any programmatic argument transformation
Responsible for returning a new instance of the component.
John Napiorkowski email:jjnapiork@cpan.org
Catalyst::Plugin::InjectionHelpers Catalyst, Catalyst::Model::InjectionHelpers::Application, Catalyst::Model::InjectionHelpers::Factory, Catalyst::Model::InjectionHelpers::PerRequest Catalyst::ModelRole::InjectionHelpers
Copyright 2016, John Napiorkowski email:jjnapiork@cpan.org
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Plugin::InjectionHelpers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::InjectionHelpers
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::InjectionHelpers
For more information on module installation, please visit the detailed CPAN module installation guide.