This is HyperactiveRecord, a not-at-all drop-in replacement for ActiveRecord::Base

It uses archipelago for persistence, and is meaningful only in an environment where the server process doesnt restart at each request. This means that cgi environment is not really an option.

Sub packages:

Hyperactive::Record

The base class package itself, providing you with cached selectors and rejectors, along with cached finders for any number of attributes.

Hyperactive::Hash

A collection class that contains any number of Hyperactive::Records in a hash like structure.

Hyperactive::List

A collection class that contains any number of Hyperactive::Records in a list like structure.

Usage:

To use Hyperactive in the simplest way, just run the script/services.rb script from the Archipelago distribution to get a few services running, then subclass Hyperactive::Record::Bass and create objects with MyBassSubclass.get_instance (not new!). They will be automagically stored in the network, and fetchable via their instance.record_id.

By loading Hyperactive::Record you will automatically define Hyperactive::Record::CAPTAIN which will be an Archipelago::Pirate::Captain that is your interface to the distributed database.

Examples:

To define a Record subclass that has the properties @active and @city that are indexed in two ways:

class MyClass < Hyperactive::Record
  attr_accessor :active, :city
  select(:active_records, Proc.new do |record|
  			      record.active == true
                          end)
  index_by(:city)
end

This will allow you to find all active MyClass instances by:

MyClass.active_records

Or finding all MyClass instances connected to Stockholm by:

MyClass.find_by_city("Stockholm")