MojoX::JSON::RPC::Service::AutoRegister - Base class for RPC Services
This object represent a base class for RPC Services. It only ovverides the new to inject 'with_mojo_tx'=1, 'with_svc_obj'=1 and 'with_self'=1 options by default. For more information on how services work, have a look at MojoX::JSON::RPC::Service.
new
'with_mojo_tx'=1
'with_svc_obj'=1
'with_self'=1
Every function that starts with rpc_ it's automatically registered as an rpc service, this means that on your service file you must only add
rpc_
__PACKAGE__->register_rpc;
at the bottom of the code. You can also defines your suffix or your regex to match the functions to being automatically registered.
Inherits all methods from MojoX::JSON::RPC::Service and adds the following new ones:
witouth arguments, register all the methods of the class that starts with "rpc_" as a RPC services
__PACKAGE__->register_rpc_suffix("somesuffix");
Accept an argument, the suffix name. Register all the methods of the class that starts with the given suffix as a RPC services (e.g. somesuffix_edit, somesuffix_lay )
__PACKAGE__->register_rpc_regex(qr//);
Accept an argument, a regex. Register all the methods of the class that matches the given regex as a RPC services
mudler <mudler@dark-lab.net>, vytas <vytas@cpan.org>
Copyright 2014- mudler, vytas
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
MojoX::JSON::RPC::Service
To install MojoX::JSON::RPC::Service::AutoRegister, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MojoX::JSON::RPC::Service::AutoRegister
CPAN shell
perl -MCPAN -e shell install MojoX::JSON::RPC::Service::AutoRegister
For more information on module installation, please visit the detailed CPAN module installation guide.