method
try_convert
v1_9_1_378 -
Show latest stable
- 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