# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true cs__scoped_require 'contrast/utils/object_share' # Some aliases within Object have to happen especially early, because they're # core to class definitions. See lib/contrast.rb. # ONLY very core aliasing should go there. All the routine extension should # happen here, where you'd expect it. class Object # Return a String representing the self invoking this method. def cs__inspect if cs__is_a?(String) return Contrast::Utils::ObjectShare::EMPTY_STRING if empty? dup elsif cs__is_a?(Symbol) ":#{ self }" elsif cs__is_a?(Numeric) to_s elsif cs__is_a?(Module) "#{ cs__name }@#{ __id__ }" else "#{ cs__class.cs__name }@#{ __id__ }" end end end