Skip to content

Commit

Permalink
every Command can show its last name
Browse files Browse the repository at this point in the history
  • Loading branch information
shelling committed Jan 14, 2013
1 parent 4b5272f commit e580346
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/HTTP/Balancer/Role/Command.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ sub prepare {
return $self; return $self;
} }


=head2 command_name
class and instance method
returns the last name of current command, lowercase, separated with whitespace.
=cut

sub command_name {
my ($self, ) = @_;
my $ref = ref($self) || $self;
$ref =~ s{HTTP::Balancer::Command::}{};
$ref =~ s{::}{ }g;
return lc($ref);
}

no Moose::Role; no Moose::Role;


1; 1;

0 comments on commit e580346

Please sign in to comment.