Module: Pry::Command::Ls::Interrogatable

Included in:
Constants, InstanceVars, Methods, SelfMethods
Defined in:
lib/pry/commands/ls/interrogatable.rb

Instance Method Summary collapse

Instance Method Details

#interrogatee_modObject (private)


13
14
15
16
17
18
19
20
# File 'lib/pry/commands/ls/interrogatable.rb', line 13

def interrogatee_mod
  if interrogating_a_module?
    @interrogatee
  else
    singleton = Pry::Method.singleton_class_of(@interrogatee)
    singleton.ancestors.grep(::Class).reject { |c| c == singleton }.first
  end
end

#interrogating_a_module?Boolean (private)


9
10
11
# File 'lib/pry/commands/ls/interrogatable.rb', line 9

def interrogating_a_module?
  Module === @interrogatee # rubocop:disable Style/CaseEquality
end