Sha256: 0ee2525aa29ac5f7a33b1e57d0910c03a62b565662a962702fbece3f90be525d

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

module Picky

  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_marshal 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

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
picky-3.0.1 lib/picky/backend/file/marshal.rb
picky-3.0.0 lib/picky/backend/file/marshal.rb