Sha256: 1d7c3c6a5f184f4112b4ec74e13fd70aaa37e7f6f75426dc6a1d30b072031df6

Contents?: true

Size: 267 Bytes

Versions: 12

Compression:

Stored size: 267 Bytes

Contents

module Toy
  module Extensions
    module Hash
      def to_store(value, *)
        Marshal.dump(value)
      end

      def from_store(value, *)
        value.nil? ? store_default : (value.class.is_a?(Hash) ? value : Marshal.load(value))
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
toy-dynamo-0.0.12 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.11 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.10 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.9 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.8 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.7 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.6 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.5 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.4 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.3 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.2 lib/toy/dynamo/extensions/hash.rb
toy-dynamo-0.0.1 lib/toy/dynamo/extensions/hash.rb