Sha256: 5dfb87cdecc2be29ffcf5cce80402dcfccd75fc793371147a2f23977b6ac35b4

Contents?: true

Size: 645 Bytes

Versions: 7

Compression:

Stored size: 645 Bytes

Contents

module Internals

  module Index
  
    class Redis
    
      class StringHash < Basic
      
        # Writes the hash into Redis.
        #
        def dump hash
          redis = backend
          hash.each_pair do |key, value|
            redis.hset namespace, key, value
          end
        end
      
        # Get a collection.
        #
        def collection sym
          raise "Can't retrieve a collection from a StringHash. Use Index::Redis::ListHash."
        end
      
        # Get a single value.
        #
        def member sym
          backend.hget namespace, sym
        end
      
      end
    
    end
  
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
picky-2.0.0.pre2 lib/picky/internals/index/redis/string_hash.rb
picky-2.0.0.pre1 lib/picky/internals/index/redis/string_hash.rb
picky-1.5.4 lib/picky/internals/index/redis/string_hash.rb
picky-1.5.3 lib/picky/internals/index/redis/string_hash.rb
picky-1.5.2 lib/picky/internals/index/redis/string_hash.rb
picky-1.5.1 lib/picky/internals/index/redis/string_hash.rb
picky-1.5.0 lib/picky/internals/index/redis/string_hash.rb