Sha256: 95800aca91a11dcff72d661657fe66f6c4143ab99d02889db8db560d8589308e

Contents?: true

Size: 241 Bytes

Versions: 18

Compression:

Stored size: 241 Bytes

Contents

module Toy
  module Extensions
    module Hash
      def store_default
        {}
      end

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

class Hash
  extend Toy::Extensions::Hash
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
toystore-0.13.2 lib/toy/extensions/hash.rb
toystore-0.13.1 lib/toy/extensions/hash.rb
toystore-0.13.0 lib/toy/extensions/hash.rb
toystore-0.12.0 lib/toy/extensions/hash.rb
toystore-0.11.0 lib/toy/extensions/hash.rb
toystore-0.10.4 lib/toy/extensions/hash.rb
toystore-0.10.3 lib/toy/extensions/hash.rb
toystore-0.10.2 lib/toy/extensions/hash.rb
toystore-0.10.1 lib/toy/extensions/hash.rb
toystore-0.10.0 lib/toy/extensions/hash.rb
toystore-0.9.0 lib/toy/extensions/hash.rb
toystore-0.8.3 lib/toy/extensions/hash.rb
toystore-0.8.2 lib/toy/extensions/hash.rb
toystore-0.8.1 lib/toy/extensions/hash.rb
toystore-0.8.0 lib/toy/extensions/hash.rb
toystore-0.7.0 lib/toy/extensions/hash.rb
toystore-0.6.6 lib/toy/extensions/hash.rb
toystore-0.6.5 lib/toy/extensions/hash.rb