summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping/matchers/base.pm
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2005-02-16 21:18:48 +0100
committerNiko Tyni <ntyni@iki.fi>2005-02-16 21:18:48 +0100
commit09df26f453b88aafaddf53c08c740d32e1342336 (patch)
tree31d0fca65fc939a40b78f768ed909a3c793b221c /lib/Smokeping/matchers/base.pm
parent94f0e104fd177a53bc73ab83838522785e785623 (diff)
downloadsmokeping-09df26f453b88aafaddf53c08c740d32e1342336.tar.gz
smokeping-09df26f453b88aafaddf53c08c740d32e1342336.tar.xz
* announce smokeping version at startup
* add matcher list to smokeping_config * make matcher names start with a capital letter * make probe names start with a capital letter * small doc updates * one more pod2html makefile fix
Diffstat (limited to 'lib/Smokeping/matchers/base.pm')
-rw-r--r--lib/Smokeping/matchers/base.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Smokeping/matchers/base.pm b/lib/Smokeping/matchers/base.pm
index cd69871..130634f 100644
--- a/lib/Smokeping/matchers/base.pm
+++ b/lib/Smokeping/matchers/base.pm
@@ -7,9 +7,12 @@ Smokeping::matchers::base - Base Class for implementing SmokePing Matchers
=head1 OVERVIEW
This is the base class for writing SmokePing matchers. Every matcher must
-inherit from the base class and provide it's own methods for the 'buisness'
+inherit from the base class and provide it's own methods for the 'business'
logic.
+Note that the actual matchers must have at least one capital letter in their
+name, to differentiate them from the base class(es).
+
=head1 DESCRIPTION
Every matcher must provide the following methods:
@@ -29,7 +32,7 @@ The new method expects hash elements as an argument
eg new({x=>'\d+',y=>'\d+'},x=>1,y=>2). The first part is
a syntax rule for the arguments it should expect and the second part
are the arguments itself. The first part will be supplied
-by the child class as it calls the partent method.
+by the child class as it calls the parent method.
=cut
@@ -41,7 +44,7 @@ sub new(@)
my $self = { param => { @_ } };
foreach my $key (keys %{$self->{param}}){
my $regex = $rules->{$key};
- croak "key '$key' is not known byt this matcher" unless defined $rules->{$key};
+ croak "key '$key' is not known by this matcher" unless defined $rules->{$key};
croak "key '$key' contains invalid data: '$self->{param}{$key}'" unless $self->{param}{$key} =~ m/^$regex$/;
}
bless $self, $class;
@@ -77,7 +80,7 @@ sub Desc ($) {
=head2 Test
Run the matcher and return true or false. The Test method is called
-with a hash of two arrays giving it access to both rtt and loss values
+with a hash of two arrays giving it access to both rtt and loss values.
my $data=shift;
my @rtt = @{$data->{rtt}};