lib/hashr.rb in hashr-0.0.8 vs lib/hashr.rb in hashr-0.0.9
- old
+ new
@@ -16,10 +16,10 @@
@definition ||= {}
end
end
def initialize(data = {}, definition = self.class.definition)
- replace(deep_hashrize(definition.deep_merge(data.deep_symbolize_keys)))
+ replace(deep_hashrize(definition.deep_merge((data || {}).deep_symbolize_keys)))
end
def []=(key, value)
super(key, value.is_a?(Hash) ? self.class.new(value, {}) : value)
end