Permalink
Browse files

every Command can show its last name

  • Loading branch information...
1 parent 4b5272f commit e580346b4afc632dcb10fe7cfe41571a84255953 @shelling committed Jan 14, 2013
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/HTTP/Balancer/Role/Command.pm
@@ -32,6 +32,22 @@ sub prepare {
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;
1;

0 comments on commit e580346

Please sign in to comment.