Module: Undo

Defined in:
lib/undo.rb,
lib/undo/model.rb,
lib/undo/config.rb,
lib/undo/version.rb,
lib/undo/environment.rb,
lib/undo/serializer/simple.rb,
lib/undo/storage/memory_adapter.rb

Defined Under Namespace

Modules: Serializer, Storage Classes: Config, Model

Constant Summary collapse

VERSION =
"0.0.1"
RUNNING_ON_CI =
!!ENV['CI']

Class Method Summary collapse

Class Method Details

.configObject



12
13
14
# File 'lib/undo.rb', line 12

def self.config
  @config ||= Undo::Config.new
end

.configure {|config| ... } ⇒ Object

Yields:



7
8
9
10
# File 'lib/undo.rb', line 7

def self.configure(&block)
  yield(config) if block_given?
  config
end

.restore(uuid, options = {}) ⇒ Object



20
21
22
# File 'lib/undo.rb', line 20

def self.restore(uuid, options = {})
  config.with(options).storage.fetch uuid
end

.wrap(object, *args) ⇒ Object



16
17
18
# File 'lib/undo.rb', line 16

def self.wrap(object, *args)
  Model.new object, *args
end