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
71 72 73 |
# File 'lib/wee/state.rb', line 71 def restore_snapshot(snap) snap.each_pair {|k,v| send(k.to_s + "=", v)} end |
#take_snapshot ⇒ Object
65 66 67 68 69 |
# File 'lib/wee/state.rb', line 65 def take_snapshot snap = Hash.new each_pair {|k,v| snap[k] = v} snap end |