summaryrefslogtreecommitdiff
path: root/lib/hashie/dash.rb
diff options
context:
space:
mode:
authorDarcy Laycock <sutto@thefrontiergroup.com.au>2011-01-20 14:24:07 +0800
committerDarcy Laycock <sutto@thefrontiergroup.com.au>2011-01-20 14:24:07 +0800
commit3ce12027af7015a22d6ec7c3e1ac7e0a9743f5fd (patch)
tree4f81b81d21bfe77096c647a7ea8d5f5f8e1df3e4 /lib/hashie/dash.rb
parent4db1a2b72c7fa4a3e1e8764da5c044f04c02aad3 (diff)
downloadhashie-3ce12027af7015a22d6ec7c3e1ac7e0a9743f5fd.tar.gz
Add in better default handling
Diffstat (limited to 'lib/hashie/dash.rb')
-rw-r--r--lib/hashie/dash.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/hashie/dash.rb b/lib/hashie/dash.rb
index 861c4ad..74612fb 100644
--- a/lib/hashie/dash.rb
+++ b/lib/hashie/dash.rb
@@ -28,8 +28,10 @@ module Hashie
self.properties << property_name
- if options[:default] or self.defaults[property_name]
+ if options.has_key?(:default)
self.defaults[property_name] = options[:default]
+ elsif self.defaults.has_key?(property_name)
+ self.defaults.delete property_name
end
unless instance_methods.map { |m| m.to_s }.include?("#{property_name}=")