NAME

ConditionalSelection - Selection with distinct conditional option sets


SYNOPSIS

  $property = new Podius::Property::ConditionalSelection;

Supposed to be used in the Podius::Component manpage and the Podius::Property manpage module trees only.


DESCRIPTION

This module implements component property of singular selection when the set of options depends on external condition. For example, the shoe sizes to choose from would be: for ``man'' - [ 38, 40, 42, 44, 46 ], for ``woman'' - [ 34, 35, 36, 37, 38 ], for ``child'' - [ 20, 25, 30, 35 ]. The type of the person (``man'', ``woman'' or ``child'')

ConditionalSelection is implemented by transparent supplying right options to Selection superclass property. For this purpose, static code-label hash must be supplied for each condition, as well as the property name (usually another Selection or Scalar) from which the condition is taken, or function that dynamically calculates the condition given this property's component.


REQUIREMENTS

the Podius::Property::Selection manpage.


CONSTRUCTORS

new

description
Class constructor.

Note, if the property package defines variable $condition_labels, then it is used, in which case the hash-of-hashes parameter must be skipped.

parameters
  * class name
  * [if needed] hash of hashes (condition => code => label)
  * initial code
  * condition (either property name or function on owner component)
returns
New formed property reference.