From d0ba24f76a247442672ed3d2a3b970374bd5fb8f Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Tue, 30 Apr 2013 15:40:50 +0200 Subject: [PATCH] Modify readme for plugins --- videosite/readme.txt | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/videosite/readme.txt b/videosite/readme.txt index 943e430..697ff42 100644 --- a/videosite/readme.txt +++ b/videosite/readme.txt @@ -143,20 +143,13 @@ declared as follows: sub new { my $class = shift; - my $self = $class->SUPER::new(); - - $self->{'_PARAMS'} = {'FOO' => [42, 'This is the FOO parameter, twiddle it to do stuff']}; - bless($self, $class); - $self->_prepare_parameters(); - - return $self; + my $self = $class->SUPER::new( + _PARAMS => {'FOO' => [42, 'This is the FOO parameter, twiddle it to do stuff']}, + @_, + ); + return bless($self, $class); } -b) as seen in the example above, after declaring the parameter hash, call the -method _prepare_parameters() on your class instance. This will convert the -hash into the internally used data structure and prepare it for automatic -loading and saving. - -c) to access one of the parameters, call the _getval() method, giving the name +b) to access one of the parameters, call the _getval() method, giving the name of the parameter as first argument. This will return the current value of that -parameter (either the default value or the user defuned value). +parameter (either the default value or the user defined value). -- 1.8.3.1