Author image Igor Sverdlov
and 1 contributors

Name

QBit::Class - base class for QBit framework.

Description

All classes must inherit QBit::Class.

Methods

new

Arguments:

  • %fields - fields to store in object.

Return value: blessed object.

init

No arguments.

Method called from "new" before return object.

mk_accessors

Arguments:

  • @fields - array of strings, names of accessors.

It generate read/write accessors.

 __PACKAGE__->mk_accessors(qw(fieldname fieldname2));
 ....
 $self->fieldname(); # return value
 $self->fieldname('newval'); # set value

mk_ro_accessors

Arguments:

  • @fields - array of strings, names of accessors.

It generate only read accessors.

 __PACKAGE__->mk_accessors(qw(fieldname fieldname2));
 ....
 $self->fieldname(); # return value

abstract_methods

Arguments:

  • @metods - array of strings, names of abstract methods.

 __PACKAGE__->abstract_methods(qw(method1 method2));
 ....
 $self->method1(); # trow exception with text "Abstract method: method1" if descendant has not override it.