NAME
Sietima::Types - type library for Sietima
VERSION
version 1.0.2
DESCRIPTION
This module is a Type::Library
. It declares a few type constraints nad coercions.
TYPES
SietimaObj
An instance of Sietima
.
EmailMIME
An instance of Email::MIME
.
Transport
An object that consumes the role Email::Sender::Transport
.
MailStore
An object that consumes the role Sietima::MailStore
.
Coercions:
MailStoreFromHashRef
-
has store => ( isa => MailStore->plus_coercions(MailStoreFromHashRef) );
Using this coercion, a hashref of the form:
{ class => 'Some::Store::Class', %constructor_args, }
will be converted into an instance of
Some::Store::Class
built with the%constructor_args
.
Address
An instance of Email::Address
.
Coercions:
AddressFromStr
-
has address => ( isa => Address->plus_coercions(AddressFromStr) );
Using this coercion, a string will be parsed into an
Email::Address
. If the string contains more than one address, only the first one will be used.
TagName
A string composed exclusively of "word" (/\w/
) characters. Used by mail stores to tag messages.
Message
An instance of Sietima::Message
.
Subscriber
An instance of Sietima::Subscriber
.
Coercions:
SubscriberFromAddress
-
has sub => ( isa => Subscriber->plus_coercions(SubscriberFromAddress) );
Using this coercion, an
Email::Address
will be converted into a subscriber that has that address as its primary. SubscriberFromStr
-
has sub => ( isa => Subscriber->plus_coercions(SubscriberFromStr) );
Using this coercion, a string will be converted into a subscriber that has the first address parsed from that string as its primary.
SubscriberFromHashRef
-
has sub => ( isa => Subscriber->plus_coercions(SubscriberFromHashRef) );
Using this coercion, a hashref will be converted into a subscriber by passing it to the constructor.
AUTHOR
Gianni Ceccarelli <dakkar@thenautilus.net>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.