Class SuperStruct
In: lib/facet/superstruct.rb
Parent: Object

Description

This is an easy way to create Struct-like classes; it converts easily between hashes and arrays, and it allows OpenStruct-like dynamic naming of members.

Unlike Struct, it creates a "real" class, and it has real instance variables with predictable names.

A basic limitation is that the hash keys must be legal method names (unless used with send()).

Basically, ss["alpha"], ss[:alpha], ss[0], and ss.alpha all mean the same.

Usage

To do.

Author(s)

  • Hal Fulton

Methods

new   open  

Public Class methods

[Validate]