Permalink
Browse files

Use method modifer to override role-provided method

Calling the role's method directly means nothing else can modify it.
  • Loading branch information...
1 parent 36c7478 commit c49e89520ada68748321d83567ebb0baf2a965f7 @ilmari ilmari committed Apr 28, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/TB2/History.pm
View
7 lib/TB2/History.pm
@@ -709,12 +709,13 @@ my @Keys_To_Add = qw(
can_succeed
test_was_successful
);
-sub keys_for_as_hash {
+around keys_for_as_hash => sub {
+ my $orig = shift;
my $self = shift;
- my @keys = grep { !$Keys_To_Remove{$_} } @{ $self->TB2::CanAsHash::keys_for_as_hash };
+ my @keys = grep { !$Keys_To_Remove{$_} } @{ $self->$orig };
return [ @keys, @Keys_To_Add ];
-}
+};
no TB2::Mouse;

0 comments on commit c49e895

Please sign in to comment.