Permalink
Browse files

Simplify call convention of add_ivar

Instead of

  s.add_ivar(self, :@ivar, @ivar)

it's now possible to alternatively use:

  s.add_ivar(self, :@ivar)
  • Loading branch information...
1 parent 9da1606 commit b53db7b1f516c39fe077f6b70ad5daa90d15610c @mneumann committed Jan 6, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/wee/state.rb
View
@@ -38,7 +38,7 @@ def add(object)
@objects[object.object_id] ||= Snapshot.new(object, object.take_snapshot)
end
- def add_ivar(object, ivar, value)
+ def add_ivar(object, ivar, value=object.instance_variable_get(ivar))
(@objects_ivars[object.object_id] ||= SnapshotIVars.new(object, {})).add(ivar, value)
end

0 comments on commit b53db7b

Please sign in to comment.