Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PStore not dead

PStore not dead

A lightning talk I gave on the Ruby User Group Berlin on 7th of August 2014.
I was talking about a nice little "gem" I found in the Ruby standard library.

Lukas Rieder

August 07, 2014
Tweet

More Decks by Lukas Rieder

Other Decks in Programming

Transcript

  1. class HotelBar ! @pstore = PStore.new("hotelbar.pstore") ! def self.pstore return

    @pstore unless block_given? @pstore.transaction { yield @pstore } end ! end
  2. require "pstore" require "json" ! class JSON::Store < PStore !

    def dump(table) JSON::pretty_generate(table) end ! def load(content) JSON::parse(content) end ! end