Sha256: 04209c6649997b81b9348387528b98ec9250a167e510b4a84e02c88445bbe743

Contents?: true

Size: 962 Bytes

Versions: 13

Compression:

Stored size: 962 Bytes

Contents

module Warp
  module Dir
    module Serializer
      class Base
        attr_accessor :store

        def initialize store
          self.store = store
        end

        def config
          self.store.config
        end

        def self.inherited subclass
          Warp::Dir::SERIALIZERS[subclass.name] = subclass
        end

        #
        # restore method should read the values from somewhere (i.e. database?)
        # and perform the following operation:
        #
        # for each [ shortcut, path ] do
        #   self.store.add(shortcut, path)
        # end

        def restore!
          raise NotImplementedError.new('Abstract Method')
        end

        #
        # save shortcuts to the persistence layer
        #
        # store.points.each_pair |shortcut, path| do
        #   save(shortcut, path)
        # end
        def persist!
          raise NotImplementedError.new('Abstract Method')
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
warp-dir-1.7.0 lib/warp/dir/serializer/base.rb
warp-dir-1.6.2 lib/warp/dir/serializer/base.rb
warp-dir-1.6.1 lib/warp/dir/serializer/base.rb
warp-dir-1.6.0 lib/warp/dir/serializer/base.rb
warp-dir-1.5.0 lib/warp/dir/serializer/base.rb
warp-dir-1.3.0 lib/warp/dir/serializer/base.rb
warp-dir-1.2.0 lib/warp/dir/serializer/base.rb
warp-dir-1.1.5 lib/warp/dir/serializer/base.rb
warp-dir-1.1.4 lib/warp/dir/serializer/base.rb
warp-dir-1.1.3 lib/warp/dir/serializer/base.rb
warp-dir-1.1.2 lib/warp/dir/serializer/base.rb
warp-dir-1.1.1 lib/warp/dir/serializer/base.rb
warp-dir-1.1.0 lib/warp/dir/serializer/base.rb