4. The Record Class

4.1. Record Documentation

Table A.4, “Record Methods” contains the exhaustive list of methods, in alphabetical order. The documentation of each method follows.

Table A.4. Record Methods

TypeNameArgs
method each() 0
method fieldName() 1
method fieldType() 1
method has_key?() 1
method indexOf() 1
method isEmpty?() 0
method isNull() 1
method keys() 0
method values() 0
method []() 1


method: []()

[]() returns the value of the field given its name or index.

Definition

def []?(key)

  • key: the name or index of the value to check.

method: each()

each() iterates over each key/value pair in the record.

method: fieldName()

fieldName() returns the field name of a field given its index.

Definition

def fieldName(index)

  • index: the index of the field whose name to return.

method: fieldType()

fieldType() returns the field type of a field given its index. It is basically going to boil down to either String or Fixnum.

Definition

def fieldType(index)

  • index: the index of the field whose type to return.

method: has_key?()

has_key?() returns true if there is a column in the row by the given name

Definition

def has_key?(name)

  • name: the of the column.

method: indexOf()

indexOf() returns the index of the column in the row by the given name

Definition

def indexOf(name)

  • name: the of the column whose index to return.

method: isEmpty?()

isEmpty?() returns true if there are no fields in the record.

method: isNull?()

isNull?() returns true if the field by the given index contains a NULL value.

Definition

def isNull?(key)

  • key: the name or index of the column to check.

method: keys()

keys() iterates over each key in the record.

method: values()

values() iterates over each value in the record.