Authen::PAAS::SimpleCallback - A callback implementation with static data


Authen-PAAS documentation Contained in the Authen-PAAS distribution.

Index


Code Index:

NAME

Top

Authen::PAAS::SimpleCallback - A callback implementation with static data

SYNOPSIS

Top

  use Authen::PAAS::SimpleCallback;

  my $cb = Authen::PAAS::SimpleCallback->new(data => "joe");

  print $cb->data, "\n";

DESCRIPTION

Top

This module provides a trivial subclass of the Authen::PAAS::Callback which always returns a pre-defined chunk of static data.

METHODS

Top

$cb = Authen::PAAS::SimpleCallback->new(data => $data);

Create a new callback object which will later provide the piece of static data defined by the data parameter. The data can be of an arbitrary Perl data type, it is treated opaquely by this module.

$cb->data;

Retrieve the data associated with this callback object. The returned data will be that which was orginally passed into the constructor.

AUTHORS

Top

Daniel Berrange <dan@berrange.com>

COPYRIGHT

Top

SEE ALSO

Top

Authen::PAAS::Context, Authen::PAAS::Callback


Authen-PAAS documentation Contained in the Authen-PAAS distribution.
# -*- perl -*-
#
# Authen::PAAS::SimpleCallback by Daniel Berrange
#
# Copyright (C) 2004-2006 Dan Berrange
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# $Id: SimpleCallback.pm,v 1.1 2005/04/23 22:45:36 dan Exp $

package Authen::PAAS::SimpleCallback;

use base qw(Authen::PAAS::Callback);

use strict;
use warnings;

our $VERSION = '1.0.0';


sub new {
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self = $class->SUPER::new();

    $self->{data} = shift;

    bless $self, $class;

    return $self;
}

sub data {
    my $self = shift;
    return $self->{data};
}

1 # So that the require or use succeeds.

__END__