App::SpreadRevolutionaryDate::Target - Role providing interface for targets of App::SpreadRevolutionaryDate.
version 0.33
This role defines the interface for any target which App::SpreadRevolutionaryDate should spread the revolutionary date to.
Any consuming class can parameterize this role (through MooseX::Role::Parameterized) with a worker type set to the effective Perl module implementing any protocol needed by this target (eg. Twitter::API, Mastodon::Client). Then, this role provides an obj required attribute with type constraint defined by the worker parameter. If no worker parameter is given, the obj type defaults to Any. Constructors of consuming classes should instanciate obj (with Moose BUILDARGS or BUILD, see Moose::Manual::Construction).
worker
obj
Any
BUILDARGS
BUILD
Any class consuming this role is required to implement a spread method, which is called with two parameters: msg, the message as a string to be spread, and test, an optional boolean which informs this method to actually spread the message if this parameter is false (that should be the default), or to just test without spreading.
spread
msg
test
false
If the target needs authentication, it can be carried out in the constructor (with Moose BUILDARGS or BUILD) or in the implementation of the spread method, obviously before actually spreading the message.
Gérald Sédrati <gibus@cpan.org>
This software is Copyright (c) 2019-2023 by Gérald Sédrati.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
To install App::SpreadRevolutionaryDate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::SpreadRevolutionaryDate
CPAN shell
perl -MCPAN -e shell install App::SpreadRevolutionaryDate
For more information on module installation, please visit the detailed CPAN module installation guide.