Sha256: ba3096c2fc14750da5692a62bdd70ce00bb18aff7951620d4e2f8fef952f0ce7

Contents?: true

Size: 726 Bytes

Versions: 1

Compression:

Stored size: 726 Bytes

Contents

module Picky

  module Backends

    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

1 entries across 1 versions & 1 rubygems

Version Path
picky-3.1.0 lib/picky/backends/file/marshal.rb