lib/hashr.rb in hashr-0.0.12 vs lib/hashr.rb in hashr-0.0.13
- old
+ new
@@ -29,9 +29,13 @@
replace((deep_hashrize(definition.deep_merge((data || {}).deep_symbolize_keys))))
deep_defaultize(self)
(class << self; self; end).class_eval(&block) if block_given?
end
+ def [](key)
+ super(key.to_sym)
+ end
+
def []=(key, value)
super(key, value.is_a?(Hash) ? self.class.new(value, {}) : value)
end
def respond_to?(name)