VS::RuleEngine::InputHandler - Handles input retrieval


VS-RuleEngine documentation  | view source Contained in the VS-RuleEngine distribution.

Index


NAME

Top

VS::RuleEngine::InputHandler - Handles input retrieval

SYNOPSIS

Top

  package MyApp::Rule;

  use base qw(VS::RuleEngine::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

Top

This class handles input retrieval for an engine. It should not be instanciated by users.

INTERFACE

Top

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.


VS-RuleEngine documentation  | view source Contained in the VS-RuleEngine distribution.