Sha256: 1f5407ef6ca3968d0d332314bdc1c40c2b1e735b27c441fee03fd7311bf38e16

Contents?: true

Size: 306 Bytes

Versions: 3

Compression:

Stored size: 306 Bytes

Contents

require 'pstore'

def memorize(options)

  $store = PStore.new("/tmp/data.pstore")
  $store.transaction do
    options.each do |key,val|
      $store[key] = val
    end
    $store.commit
  end
end

def retrieve(key)
  $store = PStore.new("/tmp/data.pstore")
  return $store.transaction { $store[key] }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-rest-rspec-0.0.5 lib/rack-rest-rspec/helpers/memorizer.rb
rack-rest-rspec-0.0.4 lib/rack-rest-rspec/helpers/memorizer.rb
rack-rest-rspec-0.0.3 lib/rack-rest-rspec/helpers/memorizer.rb