Get ‘#inspect` without `exception` and `nil` possibilities
'0.1.0'
Returns:
18 19 20 21 22 23 24 25 26
# File 'lib/string/safe_inspector.rb', line 18 def self.inspect_for(object) first_choice = begin String.try_convert(object.inspect) rescue Exception nil end (first_choice || second_choice_for(object) || fallback_for(object)).dup end