Sha256: b818521b573fe1edc677146c3f2b410698ab5b301e17c5b2ab3e1dc5658dfd06

Contents?: true

Size: 482 Bytes

Versions: 12

Compression:

Stored size: 482 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]
  def real_mod_name(mod)
    UNBOUND_METHOD_MODULE_NAME.bind(mod).call
  end
end

Version data entries

12 entries across 9 versions & 3 rubygems

Version Path
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/real_mod_name.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/zeitwerk-2.2.0/lib/zeitwerk/real_mod_name.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/real_mod_name.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/zeitwerk-2.2.0/lib/zeitwerk/real_mod_name.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/zeitwerk-2.2.0/lib/zeitwerk/real_mod_name.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/zeitwerk-2.2.0/lib/zeitwerk/real_mod_name.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/zeitwerk-2.2.0/lib/zeitwerk/real_mod_name.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/real_mod_name.rb
zeitwerk-2.2.0 lib/zeitwerk/real_mod_name.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/real_mod_name.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/zeitwerk-2.1.10/lib/zeitwerk/real_mod_name.rb
zeitwerk-2.1.10 lib/zeitwerk/real_mod_name.rb