lib/undo.rb in undo-0.1.0 vs lib/undo.rb in undo-0.1.1
- old
+ new
@@ -8,27 +8,27 @@
end
def self.store(object, options = {})
config.with(options) do |config|
uuid(object, options).tap do |uuid|
- config.storage.put uuid, config.serializer.serialize(object)
+ config.storage.put uuid,
+ config.serializer.serialize(object, config.filter(options))
end
end
end
def self.restore(uuid, options = {})
config.with(options) do |config|
- config.serializer.deserialize config.storage.fetch(uuid)
+ config.serializer.deserialize config.storage.fetch(uuid),
+ config.filter(options)
+
end
end
def self.wrap(object, options = {})
+ options[:uuid] ||= uuid object, options
config.with(options) do |config|
- Wrapper.new(
- object,
- uuid(object, options),
- mutator_methods: config.mutator_methods
- )
+ Wrapper.new object, options.merge(mutator_methods: config.mutator_methods)
end
end
private
def self.uuid(object, options = {})