Sha256: 03b8c1cd0cd3f940dadf3788542149cd6c903104a3d19fb1d0a2563b9eb47582

Contents?: true

Size: 667 Bytes

Versions: 2

Compression:

Stored size: 667 Bytes

Contents

module Backend
  
  module File
  
    # Index data in the Ruby Marshal format.
    #
    class Marshal < Basic
    
      # Uses the extension "dump".
      #
      def extension
        :dump
      end
      # Loads the index hash from marshal format.
      #
      def load
        ::Marshal.load ::File.open(cache_path, 'r:binary')
      end
      # Dumps the index hash in marshal format.
      #
      def dump hash
        hash.dump_marshalled cache_path
      end
      # A marshal file does not provide retrieve functionality.
      #
      def retrieve
        raise "Can't retrieve from marshalled file. Use text file."
      end
    
    end
  
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
picky-2.7.0 lib/picky/backend/file/marshal.rb
picky-2.6.0 lib/picky/backend/file/marshal.rb