The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Object::Meta - Library to manage data and meta data as one object but keeping it separate

DESCRIPTION

Object::Meta implements a Class to manage a data and additional meta data as an object

Of special importance is the Index Field which is use to create an automatical index in the Object::Meta::List.

It does not require lengthly creation of definition modules.

METHODS

Constructor

new ( [ DATA ] )

This is the constructor for a new Object::Meta object.

DATA - is physical data which is passed in a hash like fashion, using key and value pairs.

Administration Methods

set ( DATA )

This method will asign values to physically Data Fields.

DATA is a list which is passed in a hash like fashion, using key and value pairs.

setMeta ( DATA )

This method will asign values to Meta Data Fields.

DATA is a list which is passed in a hash like fashion, using key and value pairs.

setIndexField ( INDEX_FIELD )

This method configure the Index Field for this object.

INDEX_FIELD - is the name of the Field which contains the Value by which the object will be indexed.

setIndexValue ( INDEX_VALUE )

This Method assigns the value for the Index Field for this object.

INDEX_VALUE - is the scalar value of the Field by which the object will be indexed.

Consultation Methods

get ( FIELD_NAME [, DEFAULT_VALUE [. IS_META ] ] )

This Method retrieves the value of the field with name FIELD_NAME for this object. It can be a Physical Field or a Meta Field.

FIELD_NAME - is the name of the Field which value it must return.

DEFAULT_VALUE - is the default value to return if the Field does not exist. (Otherwise it would return undef)

IS_META - whether the FIELD_NAME is a Meta Field.

getMeta ( FIELD_NAME [, DEFAULT_VALUE ] )

This Method retrieves the value of the Meta Field with name FIELD_NAME for this object.

FIELD_NAME - is the name of the Field which value it must return.

DEFAULT_VALUE - is the default value to return if the Field does not exist. (Otherwise it would return undef)

getIndexField ()

This method retrieves the Name of the Index Field with the object will be indexed.

The name of the Index Field is a Meta Field which is stored separately.

Returns: The Name of the Index Field or an empty String if the Field is not set.

getIndexValue ()

This method retrieves the Value of the Index Field by which the object will be indexed.