« blib/lib/Bot/Cobalt/Conf/File/PerPlugin.pm
↑ Summary
blib/lib/Bot/Cobalt/Plugin/OutputFilters/StripColor.pm »
| 1 | package Bot::Cobalt::Conf::File::Channels; | ||||||||||
| 2 | 2 | $Bot::Cobalt::Conf::File::Channels::VERSION = '0.021003'; | |||||||||
| 3 | 2 | ▶ | use strictures 2; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use Bot::Cobalt::Common ':types'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | extends 'Bot::Cobalt::Conf::File'; | |||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 2 | ▶ | sub context { | ||||||||
|
Subroutine
context: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 14 | 2 | my ($self, $context) = @_; | |||||||||
| 15 | 2 | ▶ | croak "context() requires a server context identifier" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | unless defined $context; | ||||||||||
| 17 | |||||||||||
| 18 | 2 | $self->cfg_as_hash->{$context} | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | 2 | ▶ | around 'validate' => sub { | ||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=14.1
| |||||||||||
| 23 | 2 | my ($orig, $self, $cfg) = @_; | |||||||||
| 24 | |||||||||||
| 25 | 2 | my @contexts = keys %$cfg; | |||||||||
| 26 | 2 | ▶ | die "There are no contexts defined.\n" unless @contexts; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | |||||||||||
| 28 | 2 | for my $context (@contexts) { | |||||||||
| 29 | die "Context directive $context is not a hash" | ||||||||||
| 30 | 2 | ▶ | unless ref $cfg->{$context} eq 'HASH'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 1 | ||||||||||
| 34 | 2 | }; | |||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | 2 | 1; | |||||||||
| 38 | __END__ | ||||||||||