NAME
Class::Declarative::EventContext - base class implementing an event context in a declarative structure.
VERSION
Version 0.01
SYNOPSIS
Each node in a Class::Declarative
structure that can respond to events can inherit from this class to get the proper machinery in place.
event_context_init()
Called during object creation to set up fields and such.
value($var), setvalue($var, $value)
Accesses the global application value named.
register_varhandler ($event, $handler)
Registers a variable handler in the event context. If there is a handler registered for a name, it will be called instead of the normal hash read and write. This means you can attach active content to a variable, then treat it just like any other variable in your code.
event_context()
Returns $self.
register_event($event, $closure), do ($event)
Registers and fires closures by name. This is the mechanism used by the 'on' tag in the core semantics. This is actually a command-line interface; fire
runs the Text::ParseWords parse_line
function on its input, and gives the event closure any list elements that come after the first word.
make_event
Given the name of a Class::Declarative
event, finds the code referred to in its callable closure.
TODO: this is not covered by unit testing!
AUTHOR
Michael Roberts, <michael at vivtek.com>
BUGS
Please report any bugs or feature requests to bug-class-declarative at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Declarative. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
LICENSE AND COPYRIGHT
Copyright 2010 Michael Roberts.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.