Permalink
Browse files

Delegate more methods from Candidate back to WrappedModule

  • Loading branch information...
1 parent c0408a0 commit 7260c2eb587588012ff9881d20d793f8b912206b @banister banister committed Feb 7, 2013
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/pry/module_candidate.rb
@@ -20,12 +20,16 @@ class Candidate
attr_reader :line
alias_method :source_line, :line
- # Methods to delegate to associated `Pry::WrappedModule instance`.
- to_delegate = [:lines_for_file, :method_candidates, :name, :wrapped,
- :yard_docs?, :number_of_candidates]
+ # Methods to delegate to associated `Pry::WrappedModule
+ # instance`.
+ private_delegates = [:lines_for_file, :method_candidates,
+ :yard_docs?, :number_of_candidates]
- def_delegators :@wrapper, *to_delegate
- private(*to_delegate)
+ public_delegates = [:wrapped, :module?, :class?, :name, :nonblank_name]
+
+ def_delegators :@wrapper, *(private_delegates + public_delegates)
+ private *private_delegates
+ public *public_delegates
# @raise [Pry::CommandError] If `rank` is out of bounds.
# @param [Pry::WrappedModule] wrapper The associated

0 comments on commit 7260c2e

Please sign in to comment.