GX::Callback::Method

Module Version: 0.2000_01

NAME

GX::Callback::Method - Method-based callback class

SYNOPSIS

# Load the class
use GX::Callback::Method;

# Create a new callback object
$callback = GX::Callback::Method->new(
invocant => MyApp::View::XML->instance,
method => 'render'
);

# Execute the callback
$callback->call( context => $context );

DESCRIPTION

This module provides the GX::Callback::Method class which extends the GX::Callback class.

METHODS

Constructor

new

Returns a new GX::Callback::Method object.

$callback = GX::Callback::Method->new( %attributes );
Attributes:
  • arguments ( ARRAY reference )

    A reference to an array with arguments to pass to the callback method when it is called.

  • invocant ( string | object ) [ required ]

    The invocant, which can be either a class name or an object.

  • method ( string ) [ required ]

    The name of the callback method.

Returns:
Exceptions:

Public Methods

arguments

Returns the callback method arguments.

@arguments = $callback->arguments;
Returns:
  • @arguments ( scalars )

call

Calls the callback method.

$callback->call( @arguments );
Arguments:
  • @arguments ( scalars )

    Additional arguments to pass to the callback method.

code

Returns a reference to the callback method.

$code = $callback->code;
Returns:
  • $code ( CODE reference )

invocant

Returns the invocant.

$invocant = $callback->invocant;
Returns:
  • $invocant ( string | object )

method

Returns the name of the callback method.

$method = $callback->method;
Returns:
  • $method ( string )

AUTHOR

Jörg A. Uzarek <uzarek@runlevelnull.de>

COPYRIGHT AND LICENSE

Copyright © 2009-2011 Jörg A. Uzarek.

This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.