Sha256: 5f1306d8a3259bbd79cc226429fcb26778ee1f6af1b9d6524b0c96f7f5ff8ee2

Contents?: true

Size: 973 Bytes

Versions: 1

Compression:

Stored size: 973 Bytes

Contents

require 'set'

require 'sequel'

# `DBStruct` presents a (SQLite3) database table in a way that
# closely mimics a Ruby `Hash` of `Struct` objects.
#
# This is an abstract base class.  To use it, you create a subclass
# using the `with` method and define the fields to be used.  This also
# associates the new class with a `Sequel` dataset.
#
# Subinstances behave similarly to Ruby's `Struct` class.  However,
# setting or reading a value accesses the corresponding database row.
#
# Each object also knows its database row ID, an integer that can be
# used to look up this object.  If a subinstance outlives its database
# row, attempting to access the fields will raise a
# {DBStruct::MissingRowError}.  You can use methods {.present?} or
# {.deleted?} to test if this has happened.
class DBStruct
  class BogoHash; end
end

require 'internal/error'
require 'internal/util'
require 'internal/dbstruct_base'
require 'internal/dbstruct_class'
require 'internal/bogohash'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
db-struct-0.1.0 lib/dbstruct.rb