NAME

ScalarList - scalar list component property


SYNOPSIS

  use Podius::Property::ScalarList;
  $l = new Podius::Property::ScalarList(['tic', 'tac']);
  $l->push('toe');
  print $l->as_string("(%s)"), "\n";


DESCRIPTION

To write.


REQUIREMENTS

the Exception manpage, the Podius::Property manpage.


CONSTRUCTORS

new

description
Class constructor.

returns
New formed property reference.

new_from_serialized

description
Class constructor. Used for deserialization.

parameters
Class name (like all constructors) and string, representing the property.

returns
New formed property reference.


METHODS

serialize

description
Used for serialization.

returns
String, representing the property, from which the property can be restored later by new_from_serialized constructor.

access

parameters
Accessor: none.

Modifier: property value to set, array ref.

returns
The resulting property value, array ref (read only).

access_as_string

description
Only accessor form is available.

This is an alias to as_string method.

access_top

description
Only accessor form is available.

This is an alias to top method.

access_push

description
Only modifier form is available.

This is an alias to push method.

as_string

parameters
  * scalar format (optional, default is '"%s"')
  * delimiter (optional, default is ', ')
returns
The string representation of this ScalarList.

push

parameters
  * a list of scalars to be pushed to the end of list
returns
The resulting property value, array ref (read only).

top

parameters
  * the last element in the list or undef
returns
Scalar.

add

description
Adds rows to the scalar list.

parameters
  * number of rows to add
  * optional scalar to initialize rows, "" by default
  * optional boolean, if true, then add to the beggining not the end
returns
Number of rows actually added, 0 on bad input.

delete

description
Delete certain rows from the scalar list.

parameters
  * number of rows to delete
  * optional boolean, if true, then delete from the beggining not the end
  * optional starting index (default 0)
returns
Number of rows actually deleted, 0 on bad input.