Class: LevelDB::Snapshot

Inherits:
Object
  • Object
show all
Defined in:
lib/leveldb/snapshot.rb

Instance Method Summary collapse

Constructor Details

#initialize(db, read_opts) ⇒ Snapshot

Returns a new instance of Snapshot.


5
6
7
8
9
# File 'lib/leveldb/snapshot.rb', line 5

def initialize(db, read_opts)
  @_db = db
  @_read_opts = read_opts
  @_snap = C.create_snapshot(@_db)
end

Instance Method Details

#inspectObject Also known as: to_s


19
20
21
# File 'lib/leveldb/snapshot.rb', line 19

def inspect
  "#<LevelDB::Snapshot:#{'0x%x' % object_id}>"
end

#reset!Object


15
16
17
# File 'lib/leveldb/snapshot.rb', line 15

def reset!
  C.readoptions_set_snapshot(@_read_opts, nil)
end

#set!Object


11
12
13
# File 'lib/leveldb/snapshot.rb', line 11

def set!
  C.readoptions_set_snapshot(@_read_opts, @_snap)
end