| 1 | package BalanceOfPower::Commands::NoArgs; | ||||||||||
| 2 | 11 | $BalanceOfPower::Commands::NoArgs::VERSION = '0.200000'; | |||||||||
| 3 | 11 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 11 | extends 'BalanceOfPower::Commands::Plain'; | |||||||||
| 6 | |||||||||||
| 7 | sub extract_argument | ||||||||||
| 8 | { | ||||||||||
| 9 | 1 | ▶ | my $self = shift; | ||||||||
|
Subroutine
extract_argument: called CC=7 SCAR=27.3
Pod
undocumented
| |||||||||||
| 10 | 1 | my $query = shift; | |||||||||
| 11 | 1 | my $extract = shift; | |||||||||
| 12 | 1 | $query = uc $query; | |||||||||
| 13 | 1 | ▶ | $extract = 1 if(! defined $extract); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 1 | my $name = $self->name; | |||||||||
| 15 | 1 | ▶ | if($query =~ /^$name$/) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | { | ||||||||||
| 17 | 1 | ▶ | if($extract) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | { | ||||||||||
| 19 | 0 | return $2; | |||||||||
| 20 | } | ||||||||||
| 21 | else | ||||||||||
| 22 | { | ||||||||||
| 23 | 1 | return 1; | |||||||||
| 24 | } | ||||||||||
| 25 | } | ||||||||||
| 26 | 0 | foreach my $syn (@{$self->synonyms}) | |||||||||
| 27 | { | ||||||||||
| 28 | 0 | ▶ | if($query =~ /^$syn$/) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | { | ||||||||||
| 30 | 0 | ▶ | if($extract) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | { | ||||||||||
| 32 | 0 | return $2; | |||||||||
| 33 | } | ||||||||||
| 34 | else | ||||||||||
| 35 | { | ||||||||||
| 36 | 0 | return 1; | |||||||||
| 37 | } | ||||||||||
| 38 | } | ||||||||||
| 39 | } | ||||||||||
| 40 | 0 | return undef; | |||||||||
| 41 | } | ||||||||||
| 42 | 11 | 1; | |||||||||