Skip to content

tsucchi/p5-Teng-Plugin-RowObjectCreationSwitcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status

NAME

Teng::Plugin::RowObjectCreationSwitcher - Teng plugin which enables/disables suppress_row_objects with guard object

SYNOPSIS

use MyProj::DB;
use parent qw(Teng);
__PACKAGE__->load_plugin('RowObjectCreationSwitcher');

package main;
my $db = MyProj::DB->new(dbh => $dbh);
{
    my $guard = $db->temporary_suppress_row_objects_guard(1); # row object creation is suppressed
    {
        my $guard2 = $db->temporary_suppress_row_objects_guard(1); # row object is created. (isn't suppressed)
        ... # do something
    }
    # dismiss $guard2 (row object creation is suppressed)
    ... # do something
}
# dismiss $guard (row object creation is unsuppressed)

DESCRIPTION

Teng::Plugin::RowObjectCreationSwitcher is plugin for Teng which provides switcher to enable/disable to generate row object. This switcher returns guard object and if guard is dismissed, status is back to previous.

METHODS

$guard = $self->temporary_suppress_row_objects_guard($bool_suppress_row_objects)

set suppress_row_objects and return guard object. When guard is dismissed, status is back to previous.

LICENSE

Copyright (C) Takuya Tsuchida.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Takuya Tsuchida tsucchi@cpan.org

About

Teng's plugin which enables/disables suppress_row_objects with guard object.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages