Skip to content

Commit

Permalink
Directly set instance var in delete_field
Browse files Browse the repository at this point in the history
  • Loading branch information
amcaplan committed Jan 31, 2016
1 parent cd37aa3 commit 788351a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dynamic_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def method_missing(mid, *args)
end

def delete_field(key)
self[key] = nil
instance_variable_set(:"@#{key}", nil)
end

def ==(other)
Expand Down

0 comments on commit 788351a

Please sign in to comment.