WordNet::

Model class

The base WordNet database-backed domain class. It’s a subclass of Sequel::Model, so you’ll first need to be familiar with Sequel (sequel.jeremyevans.net/) and especially its Sequel::Model ORM.

Attributes

registered_models R

Public Class Methods

db=( newdb )

Reset the database connection that all model objects will use.

# File lib/wordnet/model.rb, line 38
def self::db=( newdb )
        Loggability.with_level( :fatal ) do
                super
        end

        self.load_registered_models if self == WordNet::Model
end
load_registered_models()

Load any models which have been registered.

# File lib/wordnet/model.rb, line 59
def self::load_registered_models
        self.registered_models.each do |path|
                require( path )
        end
end
register_model( name )

Register a model subclass path to load when the database is connected. If there’s already a database connection, just ‘require` it immediately.

# File lib/wordnet/model.rb, line 49
def self::register_model( name )
        if @db
                require( name )
        else
                self.registered_models << name
        end
end