| 1 | package Bot::Cobalt::IRC::Server; | ||||||||||||
| 2 | 1 | $Bot::Cobalt::IRC::Server::VERSION = '0.021003'; | |||||||||||
| 3 | ## A server context. | ||||||||||||
| 4 | |||||||||||||
| 5 | 2 | ▶ | use v5.10; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 2 | ▶ | use strictures 2; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 2 | ▶ | use Bot::Cobalt::Common qw/:types/; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 1 | ▶ | use IRC::Utils qw/lc_irc uc_irc/; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 1 | ▶ | use Moo; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | |||||||||||||
| 13 | 1 | has name => ( | |||||||||||
| 14 | required => 1, | ||||||||||||
| 15 | is => 'rw', | ||||||||||||
| 16 | isa => Str, | ||||||||||||
| 17 | ); | ||||||||||||
| 18 | |||||||||||||
| 19 | 1 | has prefer_nick => ( | |||||||||||
| 20 | required => 1, | ||||||||||||
| 21 | is => 'rw', | ||||||||||||
| 22 | isa => Str, | ||||||||||||
| 23 | ); | ||||||||||||
| 24 | |||||||||||||
| 25 | 1 | has irc => ( | |||||||||||
| 26 | is => 'rw', | ||||||||||||
| 27 | isa => Object, | ||||||||||||
| 28 | predicate => 'has_irc', | ||||||||||||
| 29 | clearer => 'clear_irc', | ||||||||||||
| 30 | ); | ||||||||||||
| 31 | |||||||||||||
| 32 | has connected => ( | ||||||||||||
| 33 | lazy => 1, | ||||||||||||
| 34 | is => 'rw', | ||||||||||||
| 35 | isa => Bool, | ||||||||||||
| 36 | clearer => 'clear_connected', | ||||||||||||
| 37 | 0 | ▶ | default => sub { 0 }, | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 38 | 1 | ); | |||||||||||
| 39 | |||||||||||||
| 40 | has connectedat => ( | ||||||||||||
| 41 | lazy => 1, | ||||||||||||
| 42 | is => 'rw', | ||||||||||||
| 43 | isa => Num, | ||||||||||||
| 44 | 0 | ▶ | default => sub { 0 }, | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 45 | 1 | ); | |||||||||||
| 46 | |||||||||||||
| 47 | has casemap => ( | ||||||||||||
| 48 | lazy => 1, | ||||||||||||
| 49 | is => 'rw', | ||||||||||||
| 50 | isa => Str, | ||||||||||||
| 51 | 0 | ▶ | default => sub { 'rfc1459' }, | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 52 | 1 | ); | |||||||||||
| 53 | |||||||||||||
| 54 | has maxmodes => ( | ||||||||||||
| 55 | lazy => 1, | ||||||||||||
| 56 | is => 'rw', | ||||||||||||
| 57 | isa => Int, | ||||||||||||
| 58 | 0 | ▶ | default => sub { 3 }, | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 59 | 1 | ); | |||||||||||
| 60 | |||||||||||||
| 61 | has maxtargets => ( | ||||||||||||
| 62 | lazy => 1, | ||||||||||||
| 63 | is => 'rw', | ||||||||||||
| 64 | isa => Int, | ||||||||||||
| 65 | 0 | ▶ | default => sub { 4 }, | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 66 | 1 | ); | |||||||||||
| 67 | |||||||||||||
| 68 | 0 | ▶ | sub lowercase { | ||||||||||
|
Subroutine
lowercase: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 69 | 0 | my ($self, $string) = @_; | |||||||||||
| 70 | 0 | ▶ | lc_irc( $string // '', $self->casemap ) | ||||||||||
|
Condition0%0/2
$string // ""
MC/DC0%0/1
$string // ""
$string
Truth table0%0/2
A
A= $string
| |||||||||||||
| 71 | } | ||||||||||||
| 72 | |||||||||||||
| 73 | 0 | ▶ | sub uppercase { | ||||||||||
|
Subroutine
uppercase: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 74 | 0 | my ($self, $string) = @_; | |||||||||||
| 75 | 0 | ▶ | uc_irc( $string // '', $self->casemap ) | ||||||||||
|
Condition0%0/2
$string // ""
MC/DC0%0/1
$string // ""
$string
Truth table0%0/2
A
A= $string
| |||||||||||||
| 76 | } | ||||||||||||
| 77 | |||||||||||||
| 78 | 1 | 1; | |||||||||||
| 79 | __END__ | ||||||||||||