NAME
Kvasir::InputHandler - Handles input retrieval
SYNOPSIS
package MyApp::Rule;
use base qw(Kvasir::Rule);
# ... constructors etc ...
sub evaluate {
# Retrieve the current input handler for the executing engine
my ($input) = @_[KV_INPUT];
# Retrieve the current value from the input 'some_input'
if ($input->get("some_input") > 10) {
return KV_MATCH;
}
return KV_NO_MATCH;
}
DESCRIPTION
This class handles input retrieval for an engine. It should not be instanciated by users.
INTERFACE
CLASS METHODS
- new ( INPUTS )
-
Creates a new input manager for the given INPUTS. INPUTS must be a list of key/value pairs.
INSTANCE METHODS
- get ( INPUT [, ARGS])
-
Retrieves the value from the input whose name is INPUT. If the input does not exist an exception is thrown. Passes any extra arguments to the inputs value function as KV_ARGS.
- set_local ( LOCAL )
-
Sets the local data for the manager.
- set_global ( GLOBAL )
-
Sets the global data for the manager.