Method: Pry::WrappedModule#method_prefix

Defined in:
lib/pry/wrapped_module.rb

#method_prefixObject

The prefix that would appear before methods defined on this class.

i.e. the “String.” or “String#” in String.new and String#initialize.

Returns:

  • String



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/pry/wrapped_module.rb', line 85

def method_prefix
  if singleton_class?
    if Module === singleton_instance # rubocop:disable Style/CaseEquality
      "#{WrappedModule.new(singleton_instance).nonblank_name}."
    else
      "self."
    end
  else
    "#{nonblank_name}#"
  end
end