method
new
rails latest stable - Class:
ActiveSupport::HashWithIndifferentAccess
new(constructor = nil)public
No documentation available.
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 70
def initialize(constructor = nil)
if constructor.respond_to?(:to_hash)
super()
update(constructor)
hash = constructor.is_a?(Hash) ? constructor : constructor.to_hash
self.default = hash.default if hash.default
self.default_proc = hash.default_proc if hash.default_proc
elsif constructor.nil?
super()
else
super(constructor)
end
end