Module: Wee::StructSnapshotMixin

Included in:
Struct
Defined in:
lib/wee/state.rb

Overview

module ObjectSnapshotMixin

Instance Method Summary collapse

Instance Method Details

#restore_snapshot(snap) ⇒ Object



88
89
90
# File 'lib/wee/state.rb', line 88

def restore_snapshot(snap)
  snap.each_pair {|k,v| send(k.to_s + "=", v)} 
end

#take_snapshotObject



82
83
84
85
86
# File 'lib/wee/state.rb', line 82

def take_snapshot
  snap = Hash.new
  each_pair {|k,v| snap[k] = v}
  snap
end