Delegate more methods from Candidate back to WrappedModule
This commit is contained in:
parent
c0408a0678
commit
7260c2eb58
|
@ -20,12 +20,16 @@ class Pry
|
||||||
attr_reader :line
|
attr_reader :line
|
||||||
alias_method :source_line, :line
|
alias_method :source_line, :line
|
||||||
|
|
||||||
# Methods to delegate to associated `Pry::WrappedModule instance`.
|
# Methods to delegate to associated `Pry::WrappedModule
|
||||||
to_delegate = [:lines_for_file, :method_candidates, :name, :wrapped,
|
# instance`.
|
||||||
:yard_docs?, :number_of_candidates]
|
private_delegates = [:lines_for_file, :method_candidates,
|
||||||
|
:yard_docs?, :number_of_candidates]
|
||||||
|
|
||||||
def_delegators :@wrapper, *to_delegate
|
public_delegates = [:wrapped, :module?, :class?, :name, :nonblank_name]
|
||||||
private(*to_delegate)
|
|
||||||
|
def_delegators :@wrapper, *(private_delegates + public_delegates)
|
||||||
|
private *private_delegates
|
||||||
|
public *public_delegates
|
||||||
|
|
||||||
# @raise [Pry::CommandError] If `rank` is out of bounds.
|
# @raise [Pry::CommandError] If `rank` is out of bounds.
|
||||||
# @param [Pry::WrappedModule] wrapper The associated
|
# @param [Pry::WrappedModule] wrapper The associated
|
||||||
|
|
Loading…
Reference in New Issue