lib/hash_delegate/accessor.rb in hash_delegate-0.0.5 vs lib/hash_delegate/accessor.rb in hash_delegate-0.0.6
- old
+ new
@@ -7,11 +7,11 @@
end
end
def define_setter(key, hash)
define_delegation "#{key}=" do |value|
- data = self.send(hash) || self.send("#{hash}=", {})
- data[key.to_s] = value
+ self.send(hash) or self.send("#{hash}=", {})
+ self.send(hash)[key.to_s] = value
end
end
private