Class: ODB::HashStore

Inherits:
DataStore show all
Defined in:
lib/odb.rb

Instance Attribute Summary

Attributes inherited from DataStore

#db, #key_cache, #name

Instance Method Summary collapse

Methods inherited from DataStore

#[], #[]=, #after_commit, #read, #write

Constructor Details

#initializeHashStore

Returns a new instance of HashStore.



147
148
149
150
# File 'lib/odb.rb', line 147

def initialize
  super(nil)
  @store = {}
end

Instance Method Details

#read_object(key) ⇒ Object



152
153
154
# File 'lib/odb.rb', line 152

def read_object(key)
  @store[key].__deserialize__(db)
end

#write_object(key, value) ⇒ Object



156
157
158
# File 'lib/odb.rb', line 156

def write_object(key, value)
  @store[key] = value.__serialize__
end