Sha256: becc6c474203399d50492040cc186bb7cf0b5787bf1ade8961af575466e64ff4

Contents?: true

Size: 1.6 KB

Versions: 3

Compression:

Stored size: 1.6 KB

Contents

module Internals

  module Index
  
    class Redis
    
      # Redis Backend Accessor.
      #
      # Provides necessary helper methods for its
      # subclasses.
      # Not directly useable, as it does not provide
      # dump/load methods.
      #
      class Basic
      
        attr_reader :namespace, :backend
      
        # An index cache takes a path, without file extension,
        # which will be provided by the subclasses.
        #
        def initialize namespace
          @namespace = namespace
          
          # TODO Turn this inside out such that people can pass in
          # their own Redis instance.
          # 
          # TODO Make the :db a real option.
          #
          @backend = ::Redis.new :db => 15
        end
      
        # Does nothing.
        #
        def load
          # Nothing.
        end
        # We do not use Redis to retrieve data.
        #
        def retrieve
          # Nothing.
        end
      
        # Redis does not backup.
        #
        def backup
          # Nothing.
        end
      
        # Deletes the Redis index namespace.
        #
        def delete
          # TODO @backend.
        end
      
        # Checks.
        #
      
        # Is this cache suspiciously small?
        #
        def cache_small?
          false # TODO
        end
        # Is the cache ok?
        #
        # A small cache is still ok.
        #
        def cache_ok?
          false # TODO
        end
        # Extracts the size of the file in Bytes.
        #
        def size_of path
          # TODO
        end
      
      end
    
    end
  
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picky-1.5.2 lib/picky/internals/index/redis/basic.rb
picky-1.5.1 lib/picky/internals/index/redis/basic.rb
picky-1.5.0 lib/picky/internals/index/redis/basic.rb