Pluggable Tax: more POD, more tests, better code and less bugs
This commit is contained in:
parent
f3ed30d939
commit
461c80a6b8
7 changed files with 602 additions and 57 deletions
|
|
@ -128,10 +128,10 @@ A WebGUI::Session object. Required in class context, optional in instance contex
|
|||
sub getDriver {
|
||||
my $self = shift;
|
||||
my $session = shift || $self->session;
|
||||
unless (defined $session && $session->isa("WebGUI::Session")) {
|
||||
WebGUI::Error::InvalidObject->throw(expected=>"WebGUI::Session", got=>(ref $session), error=>"Need a session.");
|
||||
}
|
||||
|
||||
WebGUI::Error::InvalidObject->throw( expected => "WebGUI::Session", got => (ref $session), error => "Need a session." )
|
||||
unless $session && $session->isa( 'WebGUI::Session' );
|
||||
|
||||
my $className = $session->setting->get( 'activeTaxPlugin' );
|
||||
my $driver = eval {
|
||||
WebGUI::Pluggable::instanciate( $className, 'new', [ $session ] );
|
||||
|
|
@ -155,9 +155,10 @@ Constructor for the WebGUI::Shop::Tax. Returns a WebGUI::Shop::Tax object.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
unless (defined $session && $session->isa("WebGUI::Session")) {
|
||||
WebGUI::Error::InvalidObject->throw(expected=>"WebGUI::Session", got=>(ref $session), error=>"Need a session.");
|
||||
}
|
||||
|
||||
WebGUI::Error::InvalidObject->throw( expected => "WebGUI::Session", got => (ref $session), error => "Need a session." )
|
||||
unless $session && $session->isa( 'WebGUI::Session' );
|
||||
|
||||
my $self = {};
|
||||
bless $self, $class;
|
||||
register $self;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue