mysql_class_from_fields

mysql_class_from_fields — creates a class to hold data of future SQL queries.

Syntax

mysql_class_from_fields (symclassname, superclass, fields)
    

Arguments

symclassname

A symbol, representing the name of the class to create.

superclass

The superclass for the newly created class, or nil.

fields

A one-dimensional array of strings specifying the names of the instance variables of the newly-created class. These names should correspond to the column names of future SQL queries.

Returns

A class named symclassname.

Description

This function creates a new class named symclassname as a derived class of superclass, using the field names in the fields array as the names of the new class's instance variables. This function's intended purpose is to create a class that can be instantiated to hold the data of future SQL queries.