Sha256: cfe9160eabff076c37c668c15856dba4fcf78d0bb440eb89019bdbdda04615e0

Contents?: true

Size: 289 Bytes

Versions: 6

Compression:

Stored size: 289 Bytes

Contents

module Toy
  module Extensions
    module Hash
      def store_default
        {}.with_indifferent_access
      end

      def from_store(value, *)
        value.nil? ? store_default : value.with_indifferent_access
      end
    end
  end
end

class Hash
  extend Toy::Extensions::Hash
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
toystore-0.6.4 lib/toy/extensions/hash.rb
toystore-0.6.3 lib/toy/extensions/hash.rb
toystore-0.6.2 lib/toy/extensions/hash.rb
toystore-0.6.1 lib/toy/extensions/hash.rb
toystore-0.6 lib/toy/extensions/hash.rb
toystore-0.5 lib/toy/extensions/hash.rb