Sha256: 2c7cb51d3bc19115aa73e0ee26f45f84e334732d34ec1f51049d21389cd0cb4b

Contents?: true

Size: 253 Bytes

Versions: 3

Compression:

Stored size: 253 Bytes

Contents

require 'speed_gun/store'

class SpeedGun::Store::MemoryStore < SpeedGun::Store
  def initialize
    @data = {}
  end

  def store(obj)
    key, val = serialize(obj)
    @data[key] = val
  end

  def load(key)
    deserialize(key, @data[key])
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
speed_gun-2.0.1 lib/speed_gun/store/memory_store.rb
speed_gun-2.0.0 lib/speed_gun/store/memory_store.rb
speed_gun-2.0.0.pre.alpha.1 lib/speed_gun/store/memory_store.rb