| 1 | package Net::RabbitFoot::Cmd::Command::delete_exchange; | ||
| 2 | |||
| 3 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | extends qw(MooseX::App::Cmd::Command); | |
| 5 | 1 | with qw(Net::RabbitFoot::Cmd::Role::Config Net::RabbitFoot::Cmd::Role::Command); | |
| 6 | |||
| 7 | 1 | has exchange => ( | |
| 8 | isa => 'Str', | ||
| 9 | is => 'rw', | ||
| 10 | required => 1, | ||
| 11 | metaclass => 'MooseX::Getopt::Meta::Attribute', | ||
| 12 | cmd_aliases => 'e', | ||
| 13 | documentation => 'exchange name', | ||
| 14 | ); | ||
| 15 | |||
| 16 | 1 | has if_unused => ( | |
| 17 | isa => 'Bool', | ||
| 18 | is => 'rw', | ||
| 19 | default => 0, | ||
| 20 | metaclass => 'MooseX::Getopt::Meta::Attribute', | ||
| 21 | cmd_aliases => 'U', | ||
| 22 | documentation => 'delete only if unused', | ||
| 23 | ); | ||
| 24 | |||
| 25 | 1 | __PACKAGE__->meta->make_immutable; | |
| 26 | 1 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 27 | |||
| 28 | 0 | ▶ | sub abstract { |
|
Subroutine
abstract: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 29 | 0 | return 'delete a exchange'; | |
| 30 | } | ||
| 31 | |||
| 32 | 0 | ▶ | sub _validate_exchange { |
|
Subroutine
_validate_exchange: not called CC=1 SCAR=6.9
| |||
| 33 | 0 | my ($self,) = @_; | |
| 34 | |||
| 35 | 0 | $self->_check_shortstr('exchange'); | |
| 36 | 0 | return; | |
| 37 | } | ||
| 38 | |||
| 39 | 0 | ▶ | sub _run { |
|
Subroutine
_run: not called CC=1 SCAR=6.9
| |||
| 40 | 0 | my ($self, $client, $opt, $args,) = @_; | |
| 41 | |||
| 42 | my $method_frame = $client->delete_exchange( | ||
| 43 | 0 | (map {$_ => $self->$_} qw(exchange if_unused)) | |
| 44 | )->method_frame; | ||
| 45 | |||
| 46 | 0 | print 'Deleted exchange', "\n"; | |
| 47 | 0 | return; | |
| 48 | } | ||
| 49 | |||
| 50 | 1 | 1; | |
| 51 | |||