Permalink
Browse files

Rename to_string to inspect

And provide a stupid to_string implementation
  • Loading branch information...
1 parent bc157b1 commit 56d899b86d76dd28acf7130cd7e02263e1840d3f @hoelzro hoelzro committed Jun 12, 2012
Showing with 25 additions and 5 deletions.
  1. +1 −1 Extension.pm
  2. +20 −0 Filter.pm
  3. +1 −1 FirstLineMatch.pm
  4. +1 −1 Inverse.pm
  5. +1 −1 Is.pm
  6. +1 −1 Match.pm
View
@@ -21,7 +21,7 @@ sub filter {
return $resource->name =~ /$re/;
}
-sub to_string {
+sub inspect {
my ( $self ) = @_;
my $re = ${$self};
View
@@ -102,9 +102,29 @@ sub is_inverted {
return 0;
}
+=head2 $filter->to_string
+
+Converts the filter to a string. This method is also
+called implicitly by stringification.
+
+=cut
+
sub to_string {
my ( $self ) = @_;
+ return "(unimplemented to_string)";
+}
+
+=head2 $filter->inspect
+
+Prints a human-readable debugging string for this filter. Useful for,
+you guessed it, debugging.
+
+=cut
+
+sub inspect {
+ my ( $self ) = @_;
+
return ref($self);
}
View
@@ -28,7 +28,7 @@ sub filter {
return /$re/;
}
-sub to_string {
+sub inspect {
my ( $self ) = @_;
my $re = ${$self};
View
@@ -27,7 +27,7 @@ sub is_inverted {
return 1;
}
-sub to_string {
+sub inspect {
my ( $self ) = @_;
my $filter = ${$self};
View
2 Is.pm
@@ -21,7 +21,7 @@ sub filter {
return $base eq $filename;
}
-sub to_string {
+sub inspect {
my ( $self ) = @_;
my $filename = ${$self};
View
@@ -24,7 +24,7 @@ sub filter {
return $base =~ /$re/;
}
-sub to_string {
+sub inspect {
my ( $self ) = @_;
my $re = ${$self};

0 comments on commit 56d899b

Please sign in to comment.