Hash.try_convert(obj) â hash or nil
Class Public methods
Try to convert obj into a hash, using #to_hash method. Returns converted hash or nil if obj cannot be converted for any reason.
Hash.try_convert({1=>2}) # => {1=>2} Hash.try_convert("1=>2") # => nil
Please login to continue.