class_accessor

Automated accessor generation

bacaro: haikuports also on HaikuPorts
Also on HaikuPorts. class_accessor

Description

This module automagically generates accessors/mutators for your class.

Most of the time, writing accessors is an exercise in cutting and pasting. You usually wind up with a series of almost identical methods, one for each piece of data in your object. While some will be unique, doing value checks and special storage tricks, most will simply be exercises in repetition.

If you make your module a subclass of Class::Accessor and declare your accessor fields with mk_accessors() then you'll find yourself with a set of automatically generated accessors, which can even be customized!

Install

Channel stable v0.51-2

This app is curated in HaikuPorts. Install it from there, it is already available in HaikuDepot.

pkgman install class_accessor

Download version 0.51-2 (any) hpkg

Careful: the file comes from HaikuPorts' own server, but installing it by hand is not the way in. It is pkgman that resolves the dependencies an .hpkg does not carry with it, and a package installed on its own may simply not run. Use the pkgman command above, unless you know exactly why you want the file.

Reviews