class Warp::Dir::Serializer::Base
Attributes
store[RW]
Public Class Methods
inherited(subclass)
click to toggle source
# File lib/warp/dir/serializer/base.rb, line 15 def self.inherited subclass Warp::Dir::SERIALIZERS[subclass.name] = subclass end
new(store)
click to toggle source
# File lib/warp/dir/serializer/base.rb, line 7 def initialize store self.store = store end
Public Instance Methods
config()
click to toggle source
# File lib/warp/dir/serializer/base.rb, line 11 def config self.store.config end
persist!()
click to toggle source
save shortcuts to the persistence layer
store.points.each_pair |shortcut, path| do
save(shortcut, path)
end
# File lib/warp/dir/serializer/base.rb, line 37 def persist! raise NotImplementedError.new('Abstract Method') end
restore!()
click to toggle source
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
# File lib/warp/dir/serializer/base.rb, line 27 def restore! raise NotImplementedError.new('Abstract Method') end