method

try_convert

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: Hash
try_convert(p1) public

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
Show source
Register or log in to add new notes.