Sha256: ba71f7f3271d3bfc058903b008e7663e803f0cebf977ccd06670f137bee6c520
Contents?: true
Size: 631 Bytes
Versions: 21
Compression:
Stored size: 631 Bytes
Contents
module Zeitwerk::RealModName UNBOUND_METHOD_MODULE_NAME = Module.instance_method(:name) private_constant :UNBOUND_METHOD_MODULE_NAME # Returns the real name of the class or module, as set after the first # constant to which it was assigned (or nil). # # The name method can be overridden, hence the indirection in this method. # # @param mod [Class, Module] # @return [String, nil] if UnboundMethod.method_defined?(:bind_call) def real_mod_name(mod) UNBOUND_METHOD_MODULE_NAME.bind_call(mod) end else def real_mod_name(mod) UNBOUND_METHOD_MODULE_NAME.bind(mod).call end end end
Version data entries
21 entries across 20 versions & 6 rubygems