Correct 'does' method
[gitmo/Mouse.git] / lib / Mouse / Util.pm
index 19876a1..4908863 100644 (file)
@@ -310,6 +310,18 @@ sub english_list {
     return join q{, }, @items, "and $tail";
 }
 
+sub quoted_english_list {
+    return qq{'$_[0]'} if @_ == 1;
+
+    my @items = sort @_;
+
+    return qq{'$items[0]' and '$items[1]'} if @items == 2;
+
+    my $tail = pop @items;
+
+    return join q{, }, (map{ qq{'$_'} } @items), qq{and '$tail'};
+}
+
 # common utilities
 
 sub not_supported{
@@ -338,8 +350,9 @@ sub dump :method {
 }
 
 # general does() method
-sub does :method;
-*does = \&does_role; # alias
+sub does :method {
+    goto &does_role;
+}
 
 1;
 __END__