Class: Rufus::Tokyo::Words
- Inherits:
-
Object
- Object
- Rufus::Tokyo::Words
- Includes:
- DystopiaLibMixin
- Defined in:
- lib/rufus/tokyo/dystopia/words.rb
Overview
Tokyo Dystopia words database.
Instance Method Summary collapse
-
#initialize(path, opts = {}) ⇒ Words
constructor
Opens/create a Tokyo Dystopia words database.
Constructor Details
#initialize(path, opts = {}) ⇒ Words
Opens/create a Tokyo Dystopia words database.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/rufus/tokyo/dystopia/words.rb', line 57 def initialize (path, opts={}) # tcwdb.h : # # enum { /* enumeration for open modes */ # WDBOREADER = 1 << 0, /* open as a reader */ # WDBOWRITER = 1 << 1, /* open as a writer */ # WDBOCREAT = 1 << 2, /* writer creating */ # WDBOTRUNC = 1 << 3, /* writer truncating */ # WDBONOLCK = 1 << 4, /* open without locking */ # WDBOLCKNB = 1 << 5 /* lock without blocking */ # }; mode = 0 @db = lib.tcwdbnew (lib.tcwdbopen(@db, path, mode) == 1) || raise_error end |