1# ----------------------------------------------------------------------------- 2# $Id: NewIRCMessage.pm 3004 2007-12-10 12:45:39Z topia $ 3# ----------------------------------------------------------------------------- 4# copyright (C) 2005 Topia <topia@clovery.jp>. all rights reserved. 5package Tiarra::Mixin::NewIRCMessage; 6use strict; 7use warnings; 8use Tiarra::IRC::Message; 9 10=head1 NAME 11 12Tiarra::Mixin::NewIRCMessage - Tiarra::IRC::Message Construction Interface Mixin 13=head1 SYNOPSIS 14 15 package foo::class; 16 use base qw(Tiarra::Mixin::NewIRCMessage); # use this 17 $this->irc_message_class->foo_class_method; 18 $this->construct_irc_message(Command => ...); 19 20=head1 DESCRIPTION 21 22Tiarra::Mixin::NewIRCMessage is define Tiarra::IRC::Message Construction Interface as Mixin. 23 24=head1 METHODS 25 26=over 4 27 28=cut 29 30=item irc_message_class 31 32 __PACKAGE__->irc_message_class; # return Tiarra::IRC::Message 33 $this->irc_message_class; # likewise. 34 35return Tiarra::IRC::Message class. you can change class to override this. 36 37=cut 38 39sub irc_message_class () { 'Tiarra::IRC::Message' } 40 41=item construct_irc_message 42 43 __PACKAGE__->construct_irc_message(...); 44 $this->construct_irc_message(...); # likewise. 45 46constraction Tiarra::IRC::Message(or specified by ->irc_message_class). 47 48=cut 49 50sub construct_irc_message { 51 my $this = shift; 52 53 $this->irc_message_class->new( 54 Generator => $this, 55 @_); 56} 57 581; 59 60__END__ 61=back 62 63=head1 SEE ALSO 64 65L<Tiarra::IRC::Message> 66 67=head1 AUTHOR 68 69Topia E<lt>topia@clovery.jpE<gt> 70 71=head1 COPYRIGHT AND LICENSE 72 73Copyright (C) 2005 by Topia. 74 75This library is free software; you can redistribute it and/or modify 76it under the same terms as Perl itself, either Perl version 5.8.6 or, 77at your option, any later version of Perl 5 you may have available. 78 79=cut 80