Cache::Memcached::Managed::Inactive - inactive Cache::Memcache::Managed object


Cache-Memcached-Managed documentation Contained in the Cache-Memcached-Managed distribution.

Index


Code Index:

NAME

Top

Cache::Memcached::Managed::Inactive - inactive Cache::Memcache::Managed object

SYNOPSIS

Top

 use Cache::Memcached::Managed::Inactive;

 my $cache = Cache::Memcached::Managed::Inactive->new;

DESCRIPTION

Top

Provides the same API as Cache::Memcached::Managed, but doesn't do anything.

AUTHOR

Top

 Elizabeth Mattijsen

COPYRIGHT

Top


Cache-Memcached-Managed documentation Contained in the Cache-Memcached-Managed distribution.

package Cache::Memcached::Managed::Inactive;

# Make sure we have version info for this module

$VERSION = '0.20';

#--------------------------------------------------------------------------
BEGIN { # We're fooling the Kwalitee checker into thinking we're strict
use strict;
}

#--------------------------------------------------------------------------
# No, we're NOT using strict here.  There are several reasons, the most
# important is that we're doing a lot of nasty stuff here.
# If you _do_ want stricture as a developer of this module, simply activate
# the line below here
#--------------------------------------------------------------------------
#use strict;

# Singleton object

my $self;

# At compile time
#  Create accessors returning undef

BEGIN {
    *$_ = sub { undef } foreach qw(
 add
 data
 decr
 delete
 delete_group
 delimiter
 directory
 expiration
 flush_all
 flush_interval
 get
 incr
 namespace
 replace
 reset
 set
 start
 stop
    );

#  Create accessors returning hash ref

    *$_ = sub { {} } foreach qw(
 errors
 get_group
 get_multi
 grab_group
 group
 stats
 version
    );

#  Create accessors returning list or hash ref

    *$_ = sub { wantarray ? () : {} } foreach qw(
 dead
 group_names
 servers
    );
} #BEGIN

# Satisfy -require-

1;

#---------------------------------------------------------------------------
#
# Class methods
#
#---------------------------------------------------------------------------
# new
#
# Return instantiated object
#
#  IN: 1 class
#      2..N hash with parameters
# OUT: 1 instantiated object

sub new { $self ||= bless {},shift } #new

#---------------------------------------------------------------------------
#
# Object methods
#
#---------------------------------------------------------------------------
# inactive
#
#  IN: 1 instantiated object
# OUT: 1 true

sub inactive { 1 } #inactive

#---------------------------------------------------------------------------

__END__